我得到這個錯誤:PHP,MySQL錯誤:列計數不在行匹配值計數1
Column count doesn't match value count at row 1
從下面的代碼:
$name = $_GET['name'];
$description = $_GET['description'];
$shortDescription = $_GET['shortDescription'];
$ingredients = $_GET['ingredients'];
$method = $_GET['method'];
//$image = $_GET['image'];
$username = $_GET['username'];
$length = $_GET['length'];
$dateAdded = uk_date();
$conn = mysql_connect('localhost', 'dbname', 'pass');
mysql_select_db('dbname');
$query = sprintf("INSERT INTO dbname (id, Name, Description, shortDescription, Ingredients, Method, Length, dateAdded, Username) VALUES ('', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
mysql_real_escape_string($name),
mysql_real_escape_string($description),
mysql_real_escape_string($shortDescription),
mysql_real_escape_string($ingredients),
//mysql_real_escape_string($image),
mysql_real_escape_string($length),
mysql_real_escape_string($dateAdded),
mysql_real_escape_string($username));
$result = mysql_query($query) or die(mysql_error());
什麼的錯誤的意思?
你有評論''mysql_real_escape_string($ image), '你的查詢等待你傳遞它的9個變量8 – afarazit 2011-05-09 02:32:55
我將以另一種方式上傳圖像。圖像鍵位於表格中,但未插入值。這可能是一個原因嗎? – 2011-05-09 02:33:40