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

Error when call dll from oracle
Hi all, please help me!

I have dll write C language, I want call it from oracle procedur

Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment

an interesting question
Greetings folks, got to ask an interesting question...

let say
i have created a function s

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

how to get different value in second view of webdynpro?
hello guys,

In ABAP webdynpro I am trying to create one application having two views.

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat

matching numbers inside ( )
I know I can match numbers by just [0-9]+, so I thought matching numbers inside ( ) would be somethi

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???

this is the code i got

comparing tables across databases sql refinement ideas required
Hi all

Via pl/sql I need to ensure that data between tables in different databases match

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