RE: [PHP] perplexed as to why this is happening...
| From: | Peter Houchin | Date: | Mon, 25 Nov 2002 01:01:30 +0000 |
| Subject: | RE: [PHP] perplexed as to why this is happening... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125850@lists.php.net to get a copy of this message | ||
thanks for that .. I must be going blind :)
> -----Original Message-----
> From: Michael Hazelden [mailto:michael.hazelden@ocado.com]
> Sent: Monday, 25 November 2002 11:44 AM
> To: 'Peter Houchin'; php_gen
> Subject: RE: [PHP] perplexed as to why this is happening...
>
>
> Ahem ...
>
> $sec=1 means "set $sec to 1"
>
> You want
>
> $sec==1
>
> :-)
>
> M.
>
> -----Original Message-----
> From: Peter Houchin [mailto:php@vfsa.com.au]
> Sent: 25 November 2002 00:53
> To: php_gen
> Subject: [PHP] perplexed as to why this is happening...
>
>
> 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"
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Control Centre.
>
> This message has been checked for all known viruses by the
> MessageLabs Virus Control Centre.
>
>
> *********************************************************************
>
> Notice: This email is confidential and may contain copyright
> material of Ocado Limited (the "Company"). Opinions and views
> expressed in this message may not necessarily reflect the
> opinions and views of the Company.
> If you are not the intended recipient, please notify us
> immediately and delete all copies of this message. Please note
> that it is your responsibility to scan this message for viruses.
>
> Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY
>
> *********************************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>