![]() |
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? |
Quote:
If you can't figure out what you need I will post it but just trying to help you learn... |
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? |
Try this link => http://us3.php.net/max
|
I couldn't find the solution there - think you could just hook me up with the query?
|
Quote:
PHP Code:
|
I tried that query earlier, it says something about an invalid group function use.
|
use this:
PHP Code:
|
yes, Brad is correct, you have to use query_first, as this would return an array, query() just returns a mysql result pointer :)
|
All times are GMT. The time now is 02:27 PM. |
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:
|