mysql 4.x -> 5.x upgrade related question
im upgrading mysql 4.x -> 5.x.
and in my php source there is mysql synxtax following.
$pt_sql = "select * from orderlist 
           where condition!='delete' 
            and lef开发者_如何学Ct(date,10)='$nday' 
           group by id ";
how can i change above mysql syntax to mysql 5.x syntax?
if anyone help me much apprecate!
thanks in advance
CONDITION is a reserved word in MySQL 5.0 (it was not in 4.1) so it must be in backticks in your queries:
select * from orderlist 
where `condition` != 'delete' 
and left(date,10)='$nday' 
group by id
You may also want to consider storing the column date as a date or storing it as datetime type and using the DATE function.
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论