Zaloguj | Zarejestruj | FAQ

MYSQL Warning occuring during Lesson 20

+ Odpowiedz

Posty: 2 Strona 1 z 1

MYSQL Warning occuring during Lesson 20

przez Black_jack » So mar 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/ 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
Avatar użytkownika


  • Posty: 3
  • Dołączył(a): So mar 07, 2015 4:48 pm

Re: MYSQL Warning occuring during Lesson 20

przez nanoverso » So mar 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.
Avatar użytkownika


  • Posty: 255
  • Dołączył(a): So maja 10, 2014 12:08 am
  • Lokalizacja: Brazil

+ Odpowiedz

Strona 1 z 1