0

我有这样的PHP代码:

$query = 'UPDATE  `user_vote` SET `container` = CONCAT(`container`, ' ;
$query .=  ",$glas";
$query .= ') WHERE `user_id` = ' . $id_u;
$this->db->query($query);

当我运行此代码时,出现以下错误:

错误号:1054

'字段列表'中的未知列',iljadu'

更新user_votecontainer= CONCAT( container, ,iljadu) WHERE user_id= 4

查询有什么问题?

4

2 回答 2

4

您在变量周围缺少引号concat()

$query = 'UPDATE  `user_vote` SET `container` = CONCAT(`container`, ' ;
$query .=  ",'$glas'";
$query .= ') WHERE `user_id` = ' . $id_u;
$this->db->query($query);
于 2012-08-10T13:12:29.833 回答
1
$query .=  ",$glas";

应该

$query .=  "$glas";
于 2012-08-10T13:11:57.850 回答