I know this is simple, but for some reason I can't get it to work:
<?php
$grleader = "Jason";
$db = mysql_connect("localhost", "indyouth_");
mysql_select_db("indyouth_registration",$db);
$result = mysql_query("SELECT * FROM students WHERE user = $grleader",$db);
$numrow = mysql_num_rows($result);
for($i = 1; $i < $numrow; $i++)
{
$row = mysql_fetch_row($result);
echo("<option value=\"$row[0]\">$row[1]</option>");
// print "<option value=", $row[1], "\">", $row[1], "</option>";
}
?>
I keep getting an error " Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/indyouth/public_html/registration/try2.php on line 7"