Here's the code:
$cartTotal = 0;
$db = mysql_connect(localhost,$un,$pw);
mysql_select_db("$db",$db);
$result = mysql_query("SELECT * FROM customer WHERE custSessID = '$PHPSESSID'",$db);
$cartTotal = mysql_num_rows($result);
Here's the problem = when the script is run the first time, everytime, $cartTotal is set to one, whether there is an entry in the DB or not! If I refresh the screen, it sets to 0.
If I echo $cartTotal at the top, I get 0, if I echo is after the script, i get one until I do something (refresh, access a page, etc). How is it setting to one initially?
It's not cache - doesn't matter the OS or browser.
Any ideas?
Thanks!