MYSQL Warning occuring during Lesson 20
Posty: 2 Strona 1 z 1
MYSQL Warning occuring during Lesson 20
I would like some help troubleshooting the last couple issues I was having. For some reason when I try to get the people.php page to load up when you click on the URL, it comes up with the following error:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/disk8/1063545/www/startingateregistry.atwebpages.com/people.php on line 21
line 21 is the while loop code( I have included the code below). I was hoping to be able to eventually format the page so that the picture and tables would be filled in based on each individual ID#. I am not sure what I am missing on this one.
Code: Select all
// Get data from the database depending on the value of the id in the URL
$strSQL = "SELECT * FROM JockeyClub WHERE id=" . $_GET["horseID"];
$rs = mysql_query($strSQL);
// Loop the recordset $rs
while($row = mysql_fetch_array($rs)) {
// Write the data of the perso
echo "<dt>Name:</dt><dd>" . $row["horsename"] . "</dd>";
echo "<dt>Owner:</dt><dd>" . $row["Owner"] . "</dd>";
echo "<dt>Age:</dt><dd>" . $row["Age"] . "</dd>";
echo "<dt>Color:</dt><dd>" . $row["Color"]. "</dd>";
}
// Close the database connection
mysql_close();
?>
Re: MYSQL Warning occuring during Lesson 20
Looks like it´s pointing that your $rs is not valid because of some error in your SQL SELECT query, check it.Strona 1 z 1