Re: perplexed as to why this is happening...

From: Date: Mon, 25 Nov 2002 00:57:34 +0000
Subject: Re: perplexed as to why this is happening...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125851@lists.php.net to get a copy of this message
Howdy, I'm doing a simple db check.. grabbing a db value, in this case $sec, based on the user name registered in the session, I've created a user called test with $sec equal to "2" but when i get to the second echo of $sec the value has changed to "1" and I can't understand why... can some one please give me some idea as to why this is happening? elseif ($_POST['cost'] >=100001){ //query db $res = mysql_query("SELECT sec FROM users WHERE uname='$_SESSION[uname]'"); $num = mysql_numrows($res) ; if ($num == 1) { //get results $sec = mysql_result($res, 0, 'sec'); echo $sec; // pulls out sec as 2 ( as is sposed to ) } if (!$sec = "1"){
Right there. Should be... if ($sec != "1"){ -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/

« previous php.general (#125851) next »