$str_q = implode(',',$q);
取出数据库里这条记录的相关字段,合并,再存。

解决方案 »

  1.   

    $q = implode( ",", $q );
    $sql = "UPDATE tablename SET `yourfield` = `yourfield` + $q WHERE `yourid` = '".一个值."'";
      

  2.   

    $sql = "UPDATE tablename SET `yourfield` = CONCAT(`yourfield`, ",", $q) WHERE `yourid` = '".一个值."'";用这个好些。嘿嘿,上面那个没有试过。
      

  3.   

    好像不行,提示:implode() [function.implode]: Bad arguments.
      

  4.   

    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
      

  5.   

    $q= array(1,2,3,4,5,6);
    $q = implode( ",", $q );
    $sql = "UPDATE tablename SET `yourfield` = CONCAT(`yourfield`, ',', $q) WHERE `yourid` = '".一个值."'";
    echo $sql;不要吓我,你怎么整滴?
      

  6.   

    $q必须是数组。
    bad arguments意思是你的$q类型不正确。
    你必须这样用
    $q = array();
    $q =.......
      

  7.   

    恩。但好像“SET `yourfield` = CONCAT(`yourfield`, ",", $q) ”的用法不对,请帮忙检查一下。测试就是这里通不过了。