PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $sql = 'SELECT "a" AS Source UNION ALL SELECT "b" AS Source UNION ALL SELECT "c" AS Source UNION ALL SELECT "d" AS Source UNION ALL SELECT "e" AS Source UNION ALL SELECT "f" AS Source UNION ALL SELECT "g" AS Source '; $result = $mysqli->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { foreach ($row as $k => $v) { if ($k == 'Source') { $seriesData[] = "'{$v}'"; } } } echo implode(',', $seriesData); }
Show:  
Copy Clear