0

环境: LAMP,Mysql:5.0,PHP:5.1.6,CentOS

我正在执行我的 SQL 查询,有时更新结果真的很奇怪。它正在更新box_status 字段为空box_status字段为枚举类型值即可A,L,R)。此更新查询循环运行。

update box_master 
    set box_to_show = '0', 
        box_status = 'L' 
where box_id = '{$param_arr['box_id']}' 
and box_status in ( 'A','L') 

我被卡住了,这个问题已经过去了 2 天,没有得到任何线索或解决方案。

从评论转移的代码

PHP

$update_sql = ""; 
$update_sql = "update box_master set box_to_show = '0', box_status = 'L' where box_id = '{$param_arr['box_id']}' and box_status in ( 'A','L') "; 

$result = mysql_query ( $update_sql, $link ); 

$update_sql = ""; 

if (mysql_affected_rows ( $link ) > 0) { 
   $param_arr ['remarks'] = " box_stock is 1 or 2 and market id is not 2, so changing box to show to 0 and box_status to L from {$param_arr['box_status']}"; 
}

表说明

 desc box_master 
 Field       Type                                               Null Key    Default Extra 
 box_id      int(10) unsigned                                   NO   PRI            auto_increment 
 box_status  enum('P','D','A','L','O','N','X','I','C','S','R')  NO          MUL     P    
 box_to_show float(12,2)                                        NO          0         
4

0 回答 0