perplexed as to why this is happening...
| From: | Peter Houchin | Date: | Mon, 25 Nov 2002 00:52:32 +0000 |
| Subject: | perplexed as to why this is happening... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-125848@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"){
echo "<font class='content'>please contact your nearest
representive</font>";
}
else {
echo $sec; // on this echo $sec has changed value from 2 to 1
Cheers
Peter
"the only dumb question is the one that wasn't asked"