<? include ('./header.php');
$query="select prodid, title FROM fatbeats_prod";
$result= mysql_query($query);
$names= mysql_fetch_assoc($result);
$query1="select prodid, price from fatbeats_prod";
$result1=mysql_query($query1);
$prices= mysql_fetch_assoc($result1);
while (list($key,$val) = each($qty)) {
$shoppingCart[$key] = $val;
}
while (list($key,$val) = each($shoppingCart)) {
$currentName = $names[$key];
$currentPrice = $prices[$key];
echo "You added $val of $currentName to your cart, which costs
$currentPrice euro. <BR>";
}
include ('./footer.php');
?>
What i need is to declare the arrays $names and $prices
And select the prodid as key and the title as val how can I do this?
I tried "select prodid as key, title as val
but that doesnt work.
thx for any help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php