Just a follow-up because I'm getting closer I think!
I tried this:
$query = "SELECT * FROM table WHERE criteria = 'photo'";
$result = mysqli_query($dbc, $query);
while ($row = mysqli_fetch_array($result)) {
$rez .= "'url(\"" . $row['col'] . "\")',<br />";
}
$rez = rtrim($rez, ",<br />");
echo $rez;
and this gives me the correct output:
Where the final comma has been stripped - Is this the correct way to remove that comma? I'm unsure how to "implode"
Also the result is now in a variable ($rez) which I think I can use inside my Javascript. Which I'm about to try.