xiao Posted April 22, 2008 Share Posted April 22, 2008 is it possible? Because I need to find an easy way to cache my query results. I have this: function sessie($qry,$product){ while($rij = mysql_fetch_assoc($qry)){ $_SESSION['qryProductid'][$product] = $rij['products_id']; $_SESSION['qryProductnaam'][$product] = $rij['products_name']; $_SESSION['qryProductprijs'][$product] = $rij['products_price']; } } If that works, how do I transform this? (old query result output) while($rij = mysql_fetch_array($qry)) { $prijs = number_format($rij['products_price'],2, ',', ''); echo "<option value=\"" . $rij['products_id'] . " - " . $prijs . "\""; if($_SESSION['productid'][$productsoort] == $rij['products_id']) echo " SELECTED "; echo ">" . $rij['products_name'] . " - €" . $prijs . "</option>\n"; } Quote Link to comment Share on other sites More sharing options...
Spaceman-Spiff Posted April 23, 2008 Share Posted April 23, 2008 You just need to transform it depending on the array keys. If you're not sure what they are, you can use print_r($_SESSION); or vardump($_SESSION); to check. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.