我正在我的脚本中执行更新查询。它返回 true 但更新查询不更新表。这是查询。我在这里缺少什么?
$connection = db::factory('mysql');
$query='update bookings SET date="'.$date.'",time_from="'.$time_from.'",time_to="'.$time_to.'",status="'.$status.'" where booker_id="'.$booker_id.'"';
if(mysql_query($query)) {
echo "success"; exit;
return true;
} else {
echo "fail"; exit;
return false;
}
这是表结构
CREATE TABLE IF NOT EXISTS `bookings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`time_from` time NOT NULL,
`time_to` time NOT NULL,
`status` varchar(250) NOT NULL,
`booker_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;