Can anyone help me please. I get the error Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in...
my code:
include("../connection.php");
$con=mysql_connect($host, $username, $password, $db_name) or die ("insert error message");
mysql_select_db("db") or die ("Couldn't find database");
$story=mysql_query("SELECT hand_story.username, hand_story.age, hand_story.occupation,
hand_story.star_sign, hand_story.cats_and_dogs, hand_story.holiday, hand_story.single,
hand_story.story, big_hand_images.username, big_hand_images.url
FROM hand_story
INNER JOIN big_hand_images
ON hand_story.username=big_hand_images.username
WHERE big_hand_images.url='$guess'");
echo (mysql_error());
while($row = mysql_fetch_assoc($story)){
$age = $row['age'];
$occupation = $row['occupation'];
$star_sign = $row['star_sign'];
$cats_and_dogs = $row['cats_and_dogs'];
$holiday = $row['holiday'];
$single = $row['single'];
$story = $row['story'];
}
I can echo out the results from database, so it's working but I can't figure out why I'm getting the error message as well.
Can anyone help? Is it something to do with my SQL query? Ta