I need some help declaring a varialbe using data generated from a database using a do/while statment.
Let me clarify what I am doing...
<?php do echo "'".($row_rcdAlsoPurchased['fldOrderID'])."', "; while ($row_rcdAlsoPurchased = mysql_fetch_assoc($rcdAlsoPurchased)); ?>
This code prints this in the browser: '3e9482f663032', '3e820bf72fe41',
I need to create a variable ($test) and have it have the value of '3e9482f663032', '3e820bf72fe41', using the do/while loop pulling the information from the database.
The above code above prints to the browser just fine. I just can't figure out out to assign the same value to a variable. I tried the code below but I get a parse error. Any ideas?
<?php $test = do echo "'".($row_rcdAlsoPurchased['fldOrderID'])."', "; while ($row_rcdAlsoPurchased = mysql_fetch_assoc($rcdAlsoPurchased)); ?>