Hi all,
Having troble with the following loop.
This is what i have:
foreach ($_SESSION['cart'] as $isbn => $qty){
$sql_charge = "select * from movie where movie_id='$isbn' AND movie_ship_charge='yes'";
$result_charge = mysql_query($sql_charge);
while ($row = mysql_fetch_array($result_charge)){
echo "$qty,";
}
}
The following correctly outputs the array of "1,2,"
I'm only echoing the $qty for testing.
What i'm wanting to do now is get the values returned from $qty and use them in the following query. This is where i am having trouble.
The following query looks like:
$pSQL = "select pcRate from postalcharges WHERE pcCountryID='14' AND pcShipType='1' AND pcWeight='$qty'";
$pSQL_result = mysql_query($pSQL);
while ($row = mysql_fetch_array($pSQL_result)){
$pcRate = $row['pcRate'];
}
Assuming the results for $qty from the first loop, eg. 1 and 2, how do i get these values into a loop using the above query?
Cheers,
micmac