任何人都可以幫助我。我得到的錯誤警告:mysql_fetch_assoc():提供的參數不是一個有效的MySQL結果資源在...警告:mysql_fetch_assoc():提供的參數不是有效的MySQL結果資源
我的代碼:
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'];
}
我可以附和了從數據庫中的結果,所以它的工作,但我無法弄清楚爲什麼我也收到錯誤信息。
任何人都可以幫忙嗎?這與我的SQL查詢有關嗎? 鉭
變量插值將在雙引號字符串中正確工作 –