$keyyy = null;while ($r = mysqli_fetch_array($rs)){ $tagg = array($r['name']); foreach ($tagg as $key) { $keyyy = $key.','; } }
印出結果是
1,2,3,4,5,
只是為什麼我 update 到數據表,都只有 5, 呢?而不是 1,2,3,4,5,
5,
UPDATE `blog` SET `tags` = '{$keyyy}' WHERE url = 'XXX'
相关分类