Jump to content

mattnyc

New Members
  • Posts

    3
  • Joined

  • Last visited

mattnyc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Maxxd - I'll definitely take a look. I now have another issue with js setInterval delaying the initial run of the function. Lot's of solutions online but they aren't working for me!
  2. 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.
  3. Hi all, Hoping for a little assistance. I run a query: $query = "SELECT * FROM table WHERE criteria = 'photo'"; $result = mysqli_query($dbc, $query); while ($row = mysqli_fetch_array($result)) { echo "'url(\"" . $row['col'] . "\")',<br />"; } and this gives me the following output: I have a couple of issues because ultimately the output needs to be used inside some Javascript. The first issue is that while the output above is almost correct/complete, it has a comma at the very end and I'm curious of a way to remove it. The second issue is that I think I may need to store the entire output (in this case three rows) in a php variable so that I can use it inside the JS <script></script>. If anyone can assist with this I'd really appreciate it! Really - I've been working on it for days now :(
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.