![]() |
php mysql help ?
i have a table called
color_guide it has several fields in it .... one of them is name what php mysql statement would i need to use to retrieve the "name" that has the most rows along with how many it has..... example : if john posted the most with 28 post i want to be able to print John : 28 since hes the top poster...... help ! |
Quote:
will not work ...... heres the problem the script does not know who is the highest ....... thats what i want to find out i want to know who is te highest by the amount of times there name is in new rows . and what the count of rows for the highest poster is ...... |
Use MAX instead of COUNT IIRC
|
Quote:
do you have a example |
here is a example database.
i have a table named color_guide with the following fields and data. ------------------------------------------------- | poster | color | info | more info | ------------------------------------------------- | john | blue | xx | xx | | joe | black | xx | xx | | chris | red | xx | xx | | john | yellow | xx | xx | | joe | xxxx | xx | xx | | john | xxxx | xx | xx | ------------------------------------------------- so in my sample database i need a query that will check who has the most rows and display the count . example : John has 3 post |
Ok, i saw that i answered wrong question (read a little too fast) and deleted my post.
You were too quick for me... Ok...I believe you may do it like this with mySQL: (I've been working for 9 hours now, so it might not work :D) PHP Code:
Example: PHP Code:
|
All times are GMT. The time now is 01:15 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|