mysql 4.x - > 5.x升级相关问题
问题描述:
即时升级mysql 4.x - > 5.x.mysql 4.x - > 5.x升级相关问题
并在我的PHP源代码中有以下的mysql synxtax。
$pt_sql = "select * from orderlist
where condition!='delete'
and left(date,10)='$nday'
group by id ";
如何将以上mysql语法更改为mysql 5.x语法?
如果有人帮我非常感谢!
在此先感谢
答
CONDITION
是在MySQL 5.0(it was not in 4.1)一reserved word所以它必须在反引号在查询:
select * from orderlist
where `condition` != 'delete'
and left(date,10)='$nday'
group by id
您可能还需要考虑存储列date
作为date
或将其存储为datetime
类型并使用DATE函数。
它不是SQL查询,而是PHP代码。请提供一个SQL查询以及确切的错误消息。 – 2010-09-11 17:56:37