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语法?

如果有人帮我非常感谢!

在此先感谢

+1

它不是SQL查询,而是PHP代码。请提供一个SQL查询以及确切的错误消息。 – 2010-09-11 17:56:37

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函数。