Hi,
I am aiming for a mini cart of some sort that simply shows the user what is in their cart at any one time.
I have successfully managed to get the quantity value and display it using the select count(*) query. Which counts the number of rows in my mysql database. Great stuff, although the page needs to be refreshed in order to display the latest value. (which i don't want)
So my common sense tells me I need a loop of some sort to constantly loop through the code.
So I was simply wondering what loop I would need, and an example would be great.
The code I have so far (using a while loop, but it still doesnt work as I am not sure what i need to put inside the brackets!):
$result = mysql_query("select count(*) from cart where session_id = '".$_COOKIE[PHPSESSID]."'");
while($row = mysql_fetch_row($result)){
$numRows = $row[0];
echo "$numRows";
}
Thanks all.