更新查询无效

时间:2014-01-13 05:23:05

标签: php mysql

我使用以下代码更新表,但不会影响任何行:

$timing = array("7.00AM-9.00AM", "9.00AM-11.00AM", "6.30PM-9.00PM");       
$id = $_GET["id"];        
$batch = $_GET["d"];       
$i = array_search($batch, $timing);     
$set = "UPDATE tbl_reg SET timing = '".$timing[$i]."' WHERE reg_id = $id";    
$setexe = mysql_query($set);      
echo mysql_affected_rows($conn);       
$res = "alloted batch successfully"; 

当我手动将相同的查询放入MySQL时,它可以工作。

有什么问题?

0 个答案:

没有答案