mysqli - PHP echo implode with single along with coma -
i trying add single coat along coma in below code , display data mentioned below (expected output)but iam unable add single coat along coma.
$query ="select * abc xyz='xyz' , standard='xyz' "; $data=mysqli_query($mysqli,$query)or die(mysqli_error()); $id = array(); while($row=mysqli_fetch_array($data)){ $id[] = $row['id']; } $idall = implode(',', $id); echo $idall;
current output
13,13k,043
expected output
'13','13k','043'
try this:
$idall = "'" . implode("','", $id) . "'";
Comments
Post a Comment