hi guys
im getting this error message
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\m82\updatethree.php on line 29
below is my code
<html>
<body>
<?php
$db = mysql_connect("localhost", "phpuser", "******");
mysql_select_db("booking",$db);
if ($submit) {
$sql = "UPDATE event_categories SET categoryID='$categoryID', category='$category'";
$result = mysql_query($sql);
echo "Thank you! Information updated.\n";
}
else {
// query the DB
$sql = "SELECT * FROM event_categories WHERE categoryID=$categoryID";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $php_SELF?>">
<input type=hidden name="categoryID" value="<?php echo $myrow["categoryID"]?>">
categoryID:<input type="Text" name="categoryID" value="<?php echo $myrow["categoryID"]?>"><br>
category:<input type="Text" name="category" value="<?php echo $myrow["category"]?>"><br>
<input type="Submit" name="submit" value="Update information">
</form>
<?php
$result = mysql_query("SELECT * FROM event_categories",$db);
while ($myrow = mysql_fetch_array($result)) {
printf("<a href=\"%s?categoryID=%s\">%s</a><br>\n", $php_SELF, $myrow["categoryID"], $myrow["category"]);
}
}
?>
</body>
</html>