$q = implode( ",", $q ); $sql = "UPDATE tablename SET `yourfield` = `yourfield` + $q WHERE `yourid` = '".一个值."'";
$sql = "UPDATE tablename SET `yourfield` = CONCAT(`yourfield`, ",", $q) WHERE `yourid` = '".一个值."'";用这个好些。嘿嘿,上面那个没有试过。
好像不行,提示:implode() [function.implode]: Bad arguments.
UPDATE mytables SET numb = CONCAT(numb, Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
$sql = "UPDATE tablename SET `yourfield` = `yourfield` + $q WHERE `yourid` = '".一个值."'";
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
$q = implode( ",", $q );
$sql = "UPDATE tablename SET `yourfield` = CONCAT(`yourfield`, ',', $q) WHERE `yourid` = '".一个值."'";
echo $sql;不要吓我,你怎么整滴?
bad arguments意思是你的$q类型不正确。
你必须这样用
$q = array();
$q =.......