help with session variables
| From: | Thomas Goeminne | Date: | Thu, 28 Nov 2002 23:44:42 +0000 |
| Subject: | help with session variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-126442@lists.php.net to get a copy of this message | ||
<? 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