[PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
May be some one could help me here, I am trying to retrieve results from a table that gives 9 rows, from each row I am trying to pull out two fields and assign the two values of those column fields to a variable $image1 and $caption1, and now I want to go to the next row and pick up the values of

Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Jason Wong
On Tuesday 04 February 2003 20:02, Geckodeep wrote: May be some one could help me here, I am trying to retrieve results from a table that gives 9 rows, from each row I am trying to pull out two fields and assign the two values of those column fields to a variable $image1 and $caption1, and now

Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
Here is a part of my code: while ($image_row = mysql_fetch_array($result_images)){ $image1 = $image_row[0][image1]; if ($image1 == ){ $image1 = $folder.logo.jpg;// it places a log when

Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Adam Voigt
$counter = 1; $query = mysql_query(SELECT image,caption FROM tablename ORDER BY id;); while($row = mysql_fetch_array($query)) { $imagevar = image . $counter; $captionvar = caption . $counter; $$imagevar = $row[image]; $$captionvar = $row[caption]; $counter++; } Change the

Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
thanks i m going to test ride it and let you know. tks again to adam jason. Adam Voigt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $counter = 1; $query = mysql_query(SELECT image,caption FROM tablename ORDER BY id;); while($row = mysql_fetch_array($query)) {

Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Geckodeep
finally i got it to work in this manner. $i=1; while ($image_row = mysql_fetch_array($result_images)){ $image=image.$i; $caption=caption.$i; $$image = $image_row[image1]; if ($$image == ){ $$image = $folder.logo.jpg; } $$caption = $image_row[caption]; $i++; } great so thanks Adams. GD