getting most records by count


Posted on 16th Feb 2014 07:03 pm by admin

Code: [Select]<?php

$connect = mysql_connect("localhost","damgears_evil","damgears");
mysql_select_db("damgears_evil");
$queryreg = mysql_query("SELECT COUNT(*) FROM titles WHERE fname = '$fname' && lname = '$lname' ");
while($row = mysql_fetch_assoc($queryreg))
{
$amountitles = $row[0];
$dbname = $row['fname'];
echo "$amoutitles $dbname";
}
?>


Basically what i want to do is if ther is a record

Jeff Smith
Jeff Smith
Jeff Smith
John Adams
John Adams
Susan Adams
Jeff Smith

I want it to count it and order it by count so the person with the highest amount of records then displays

$amounttitles - $dbname

and limit to top 10.

thanks

No comments posted yet

Your Answer:

Login to answer
92 Like 46 Dislike
Previous forums Next forums
Other forums

How to make a input/output field with multiple lines
Hello.
I put a input/output field on the screen but I could not change height of it. I need to

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin

help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "

how to transport the Query and insfoset
Hi

I have created the query using SQ01........
How to created T-code for query..

please help
HTML Code:

Code: <span id="ctl00"><span>

Oracle11g Patch issue
Hi all,

I'm getting the following error while installing Oracle11g Patch 11.1.0.7.0 on IBM-AI

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash