error
| From: | Adv. Systems Design | Date: | Fri, 11 Aug 2000 15:47:38 +0000 |
| Subject: | error | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1964@lists.php.net to get a copy of this message | ||
Hi:
<Newbie alert>
I am trying to get a mysql query to fill up a popup
menu using info supplied in previous page, and I keep
getting this: Warning: Supplied argument is not a
valid MySQL result resource in
/home/httpd/html/benchmark/bench.php on line 98; (line
98 is the while statement)...what am I doing wrong?
The code is:
<?
define ("NL", "<BR>\n");
$hostname = "localhost";
$username = "webuser";
$password = "password";
$dbName = "Benchmark";
$con = mysql_connect("$hostname", "$username",
"$password") or DIE("Database Failed to Respond");
mysql_select_db("$dbName", $con) or DIE("Table
Unavailable ($dbName)");
$result = mysql_query("SELECT strand FROM Strand where
subj=$subject",$con);
print ("<B>Your Subject Selection:</B>$subject" . NL);
print ("<B>Your Grade Level Selection:</B>$level" .
NL);
print ("<B>Select a Strand:</B>");
echo "<select name=strand>\n";
while ($row = mysql_fetch_array($result)) {
echo "<option value=\"" . $row["value"] . "\">" .
$row["strand"] . "\n";
}
echo "</select>";
?>
Thanks
Luis
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/