登录 | 注册 | FAQ
Anonymous

MYSQL Warning occuring during Lesson 20

+ 发表回复

2 篇帖子 分页: 1 / 1


MYSQL Warning occuring during Lesson 20

Black_jack » 周六 3月 21, 2015 2:11 pm

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();
?>
头像

Black_jack

  • 帖子: 3
  • 注册: 周六 3月 07, 2015 4:48 pm

Re: MYSQL Warning occuring during Lesson 20

nanoverso » 周六 3月 21, 2015 9:11 pm

Looks like it´s pointing that your $rs is not valid because of some error in your SQL SELECT query, check it.
头像

nanoverso

  • 帖子: 253
  • 注册: 周六 5月 10, 2014 12:08 am
  • 地址: Brazil
--
Free VST Plugins Download.


+ 发表回复

分页: 1 / 1