MySQL Results into Array for Future Use.
Posted: Mon Mar 10, 2003 1:02 pm
Afternoon,
Okay, got a quick one here, that I hope will have me kicking my self. What I am trying to do is pull data from a database, and store it in an Array so that I can reference it later to be displayed.
This is what I have so far, but the array only holds the first value.
And here is how I am calling the Array
Any Ideas??
Okay, got a quick one here, that I hope will have me kicking my self. What I am trying to do is pull data from a database, and store it in an Array so that I can reference it later to be displayed.
This is what I have so far, but the array only holds the first value.
Code: Select all
if(mysql_num_rows($result)){
$emailaddress = mysql_result($result,$i,"email_address");
$amount =mysql_result($result,$i,"amount");
$reason = mysql_result($result,$i,"reason");
$item = array();
while ($number > $i) {
$itemї]="$reason";
}Code: Select all
while (list($key,$value)= each($item)){
print "$key :: $value";
}