I am new to arrays
Using the following code , only the first array description produces results outside of the loop
If I reverse the sequence of the 2 arrays, then the first array price produces results outside
Can someone tell me what is missing.
Thanks
$Link = mysql_connect ($hostname, $username, $password);
$Query = "SELECT * FROM cart WHERE cookieId = '".$cookieId."'";
$Result = mysql_db_query ($dbname, $Query, $Link);
$description=array();
$description[1] = 'empty';
while ($Row3 = mysql_fetch_array ($Result)) {
$refarray=$refarray+1;
$description[$refarray] = $Row3[2];
print "description ".$description[$refarray]."<BR>";
}
$Link = mysql_connect ($hostname, $username, $password);
$Query2 = "SELECT * FROM cart WHERE cookieId = '".$cookieId."'";
$Result = mysql_db_query ($dbname, $Query2, $Link);
$price=array();
$price[1] = 'empty';
while ($Row2 = mysql_fetch_array ($Result)) {
$refarray=$refarray+1;
$price[$refarray] = $Row2[4];
print "price ".$price[$refarray]."<BR>";
}
print " desc2 ".$description[2]."<BR>";
print " price2 ".$price[2]."<BR>";