For the last 1 1/2 days I've been trying to store 16 row id's into a string and separate each id with a comma. The array I am getting is from MySQL. The error I am getting is "implode() function:passed invalid arguments"
$str=array();
$string="";
while($row = mysql_fetch_row($result))
{
$user_id=$row;
$str=$user_id;
foreach($str as $p=>$v){
comma($v);
}
}
function comma($v){
$string= implode(",",$v); echo $string;
}
mysql_*
functions, since they're a) insecure, and b) being deprecated (see the red box). You should be using prepared statements with PDO or MySQLi instead. – Ricardo Altamirano Jul 22 '12 at 11:53