Oppure

Codice PHP:

<?php

$array  
= array();
$result mysqli_query($con,"SELECT * FROM brand");

while(
$row mysqli_fetch_array($result)) {
  
$array[] = "'"$row['brand'] ."'";
}
$string implode(',',$array);
print 
$string;
?>