我有一行要更改的代码...原来的行是插入 Unix 时间,但我想要 CURRENT_TIMESTAMP 或 NOW。我已将数据库中的字段更改为“日期时间”类型。但是,当我更改代码时,我收到以下错误消息:发送消息时出错。列计数与第 1 行的值计数不匹配
这是原始代码,然后是我尝试更改它的方式。任何帮助将不胜感激!
原始代码:
//if(mysql_query('insert into pm (id, id2, title, user1, user2, message, date_time, user1read, user2read)values("'.$id.'", "'.(intval(mysql_num_rows($req2))+1).'", "", "'.$_SESSION['username'].'", "", "'.$message.'", "'.time().'", "", "")') and mysql_query('update pm set user'.$user_partic.'read="yes" where id="'.$id.'" and id2="1"'))
修改代码:
if(mysql_query('insert into pm (id, id2, title, user1, user2, message, date_time, user1read, user2read)values("'.$id.'", "'.(intval(mysql_num_rows($req2))+1).'", "", "'.$_SESSION['username'].'", "", "'.$message.'", CURRENT_TIMESTAMP())') and mysql_query('update pm set user'.$user_partic.'read="yes" where id="'.$id.'" and id2="1"'))