我有這個小小的代碼片段,但它現在不是真的有效。我總是有資源ID#5錯誤。我在谷歌搜索了幾個指針,但沒有發現mutch來通過這個問題。在這裏我的代碼mysql錯誤資源ID#5
<?php
include 'load_db.php';
$var1 = $_POST["gender_1"];
$var2 = $_POST["gender_2"];
$var3 = $_POST["age"];
$sql = mysql_query("SELECT url FROM links WHERE gender ='".$var1."' AND gender1 ='".$var2."' AND age ='".$var3."'");
$result_1 = mysql_query($sql)
OR die("Error: $sql </br>".mysql_error());
echo $result_1;
?>
Error: Resource id #5
什麼在 「load_db.php」? – BugFinder
'<? $ dbname =「lp」; $ dbhost =「localhost」; $ dbuser =「root」; $ dbpass =「」; mysql_connect($ dbhost,$ dbuser,$ dbpass); mysql_select_db($ dbname); ?>'是在load_db.php – Johnny000
沒關係...... – ashiaka