im writing a simple piece of code to search through a table and pick out only a certain row:
here is the query:
Code:
$query=mysql_query("SELECT * FROM users WHERE index=5");

$bandname=mysql_result($query,"bandname");
im thinking this should only find the row with the index = 5 and then take the bandname column and save it to the variable $bandname. but instead i get this error:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/commot/public_html/bb/infopage.php on line 24

i know theres an easy fix, but i cant figure it out