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");
Did you know?Explore Trending and Topic pages for more stories like this.
$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

type check while uploading
Hi Everyone,

How can I check the exact type of a file while uploading on my site?

Here

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable

Trouble with a select list
Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those.

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

Business Health Check
Hello

I need to create an online business health check for a client it will be multiple choi

Date help - fetch dates for Mondays between xxx and yyy?
Does anyone know the best way to do this? I have two dates, say:

2010-01-26 and 2010-05-30

Cache PHP Objects/Classes?
Does anyone have ideas about caching PHP objects using something like: http://memcached.org/

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