The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Selecting the Strongest Character?
I've got somewhat of an RPG system going on, and I want to select and display the strongest member from a table.
I think it should look something like... $strongguy = $DB_site->query("SELECT * FROM table ORDER BY column DESC LIMIT 1"); After which, I would put {$strongguy['name'} in the template, but I seem to get some kind of resource error each time. Is something wrong with my query? |
#2
|
|||
|
|||
Quote:
If you can't figure out what you need I will post it but just trying to help you learn... |
#3
|
||||
|
||||
Eh, I'm not sure how to select the highest value of a field. I'm guessing I need something about "WHERE", but I wouldn't know. Any knowledge I have of this is based on other hacks I've installed, and I don't see a similiar query anywhere.
Care to elaborate for me? |
#4
|
|||
|
|||
Try this link => http://us3.php.net/max
|
#5
|
||||
|
||||
I couldn't find the solution there - think you could just hook me up with the query?
|
#6
|
|||
|
|||
Quote:
PHP Code:
|
#7
|
||||
|
||||
I tried that query earlier, it says something about an invalid group function use.
|
#8
|
|||
|
|||
use this:
PHP Code:
|
#9
|
||||
|
||||
yes, Brad is correct, you have to use query_first, as this would return an array, query() just returns a mysql result pointer
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|