开发者

Problem with PHP MYsql Delete syntax with timestamp comparison

开发者 https://www.devze.com 2023-03-12 14:48 出处:网络
All I am trying to do is delete rows in a column that have a timestamp more than 2 days old. I have tried a lot of things I have seen on here, but none of them seem to be working.

All I am trying to do is delete rows in a column that have a timestamp more than 2 days old.

I have tried a lot of things I have seen on here, but none of them seem to be working.

This i开发者_StackOverflow社区s the code:

$delquery = $tapeDB->query('DELETE FROM newsItems WHERE news_date < TIMESTAMPADD(DAY,-2,NOW());

These are the errors I am getting on that line:

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in... Parse error: syntax error, unexpected T_STRING in...

This should be really easy but I can't figure out what I am doing wrong.


you forgot the closing quote

$delquery = $tapeDB->query('DELETE FROM newsItems WHERE news_date < TIMESTAMPADD(DAY,-2,NOW()');
0

精彩评论

暂无评论...
验证码 换一张
取 消