$stuff= mysql_query("SELECT id FROM talbe WHERE id>0 ORDER BY money DESC;"); while ($omg= mysql_fetch_array($stuff)) I see a lot of those in my code, can't it just be pulled with one command or what? mysql_fetch_array(mysql_query
no my friend it wont work..first you need to fire query then only result can be fetched from array...
Here is an example, notice that I've used the newer "mysqli" variant and that is has slightly different parameter requirements (notably a "link" for query actions). $sql = "..."; if ( !$res=mysqli_query($link,$sql) ) die("ERROR: Unable to query!\n"); while ( $row=mysqli_fetch_assoc($res) ) { ... } mysqli_free_result($res); Code (markup):