我有这样的声明:
$query="INSERT INTO error_report(task_id,url_is_route, forbidden_word, google_host_fail, google_cache_fail, google_title_fail, google_element_fail, robots_noindex_nofollow, xrobots_noindex_nofollow, title_fetch_warn, h1_fail,h2_fail,h3_fail ,h1_warn ,h2_warn, h3_warn)
VALUES (".$this->task_id.",0,0,0,0,0,0,0,0,0,0,0,0,0,0)";
mysql_query($query) or die(mysql_error());
我明白了:
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 2 行的 '0,0,0,0,0,0,0,0,0,0,0,0,0,0)' 附近使用正确的语法
问题出在哪里?
更新
$query="INSERT INTO error_report(task_id,url_is_route, forbidden_word, google_host_fail, google_cache_fail, google_title_fail, robots_noindex_nofollow, xrobots_noindex_nofollow, title_fetch_warn, h1_fail,h2_fail,h3_fail ,h1_warn ,h2_warn, h3_warn)
VALUES ('".$this->task_id."','0','0','0','0','0','0','0','0','0','0','0','0','0','0')";
现在我得到:
不正确的整数值:第 1 行的列 'task_id' 的 ''