Jump to content

azonicds2

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

azonicds2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ignace you are a god! That worked brilliantly. Thank you very much for that. Very much appreciated! I had tried to use implode before but i wasn't using it correctly obviously. Thanks mate! Danny
  2. Have tried that Robert and i can't get that to work either. Any other ideas? Looking at my code am i going about this the wrong way, should i be using some sort of count? Thanks a lot!
  3. Wont that do it for every row though, rather than just the last one? Thanks
  4. Hi guys Had some great help from here before so thought id try my luck again. Basically i have an array query that works fine, but the echo is going into a piece of Javascript, its basically telling the Java what image paths to use for a Slideshow, each of these needs to be seperated by a comma. Accept for the last one in the array needs to have the comma removed. I can remove the last comma for each row no problem but thats where the problem lies. I only want to remove it from the last row in the array. Any ideas? My code is as follows: <?php $query2 = mysql_query("SELECT * FROM homeimages ORDER by Filename ASC") or die(mysql_error()); while ($row2=mysql_fetch_array($query2)){ $string = "['http://www.benbrownphotography.co.uk/images/home/upload/".$row2['Filename']."'],"; $output = substr_replace($string,"",-1); echo "$output"; } ?> This is fine for if there is only one row in the database but when you add more it is obviously removing the comma from every row. How can i remove it only from the last row in the array? Thanks a lot in advance! Danny
×
×
  • 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.