Hey all. I have a database "DB" with a table called "users". There are multiple columns in the table but the important ones are "names" and "totals". I'm trying to get php to find the record with the highest Value under "totals" then store that records "name" with "totals" value in () like... John Doe (27) in variable $totalmembers. So far i'm stuck at getting php to retrieve the proper record. It's only returning the record for entry 1 in my database which does not have the highest "totals" value. Here's my code let me know what i'm doing wrong. Thanks in advance.
<?php
mysql_connect("localhost", "root")
mysql_select_db("DB");
$totalmembers = mysql_query ("SELECT name FROM users WHERE totals = (SELECT MAX(totals))") or die(mysql_error());
list ( $totalmembers ) = mysql_fetch_row ( $totalmembers );
?>