note 96272 rejected from function.end by thiago

From: Date: Thu, 18 Feb 2010 00:03:26 +0000
Subject: note 96272 rejected from function.end by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166103@lists.php.net to get a copy of this message
Note Submitter: public at tmsessions dot com ---- I've got a javascript image array that I've put a php/sql query in to pull the file paths, and the query echos the file path and then a comma. My gallery works great...except for in IE (grrr) and the problem is, I need to remove the comma from the last result. I'm just having an awfully hard time trying to get that to work. I'm pretty sure it has something to do with the end() function but I'm stuck. Any ideas? Thanks! var mygallery2=new fadeSlideShow({ wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow dimensions: [329, 250], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [<? $query = "SELECT * FROM gallery WHERE gall_id =2 ORDER BY image_id ASC"; $result = mysql_query($query) or die('Whoops try again '); if (mysql_num_rows($result) == 0) {} else { while($row=mysql_fetch_array($result, MYSQL_ASSOC)) { $image_id = $row['image_id']; $gall_id = $row['gall_id']; $desc = $row['desc']; $filepath = $row['filepath']; $caption = $row['caption']; $short_path = "[\"http://www.domain.us/thumbs/$filepath\", \"\", \"\", \"$caption\" ],"; echo $short_path; } } ?>], displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true}, persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "always", togglerid: "fadeshow2toggler" }) </script>

« previous php.notes (#166103) next »