Re: Usng Session Vaiable in WHERE Statement
| From: | Afan Pasalic | Date: | Mon, 26 Jul 2004 14:30:45 +0000 |
| Subject: | Re: Usng Session Vaiable in WHERE Statement | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191884@lists.php.net to get a copy of this message | ||
I think he has to keep the single quotes and add double quotes with dots:
$MembersDataQry = "SELECT * FROM MembersData WHERE UserID=' ".$_SESSION['logname']'." ' ";
afan
At 09:24 AM 7/26/2004, Jason Davidson wrote:
hey, just take the single quotes around the word logname out and you should be ok. Jason On Mon, 26 Jul 2004 12:58:28 +0100, Harlequin <michael.mason@arraspeople.co.uk> wrote: Could someone please help me with my syntax here...? $MembersDataQry = "SELECT * FROM MembersData WHERE UserID='$_SESSION['logname']'"; I get an error on line 2 but can't seem to figure out what I've missed. The variable echoes fine so I know there's a string in there. -- ----------------------------- Michael Mason Arras People www.arraspeople.co.uk ----------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php