The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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 ! |
#2
|
||||
|
||||
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 ...... |
#3
|
||||
|
||||
Use MAX instead of COUNT IIRC
|
#4
|
||||
|
||||
Quote:
do you have a example |
#5
|
||||
|
||||
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 |
#6
|
|||
|
|||
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 ) PHP Code:
Example: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|