我的查詢沒有插入,我沒有收到任何錯誤。想不通爲什麼它不插入mysql查詢插入問題
foreach($_POST as $key => $value) {
$clean[$key] = mysql_real_escape_string($value);
}
if(isset($_POST['submit'])) {
$entry = "INSERT INTO test (Word, Type, Lang, Country, Gender, Advice, y_Advice, Notes,
EditorNotify, Equiv)
VALUES('".$clean["word_field"]."',
'".$clean["type_field"]."',
'".$clean["lang"]."',
'".$clean["Country"]."',
'".$clean["gender"]."',
'".$clean["advice"]."',
'".$clean["y_advice"]."',
'".$clean["Notes"]."',
'".($clean["Notes"] != '' ? '1' : '')."',
'".$clean["Equiv"]."')";
echo mysql_query ($entry);
mysql_query ($entry);
執行'echo mysql_error();'查看錯誤 – 2010-11-09 11:59:21
執行查詢後'echo mysql_error();'的輸出是什麼? http://us3.php.net/manual/en/function.mysql-error.php – 2010-11-09 12:00:27
也許你不進入條件,因爲$ _POST ['submit']沒有設置 – 2010-11-09 12:00:50