RE: [PEAR] Pear Auth and SQL

From: Date: Sat, 08 Dec 2001 23:52:26 +0000
Subject: RE: [PEAR] Pear Auth and SQL
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-589@lists.php.net to get a copy of this message
Thanks Jason This worked a treat! Simon -----Original Message----- From: Jason G. [mailto:blair@nb.net] Sent: 08 December 2001 23:35 To: Simon H; Pear-General Subject: Re: [PEAR] Pear Auth and SQL Your $a will be taken literally rather that interpolated. Use this: $UserDetailsSQL = 'SELECT * FROM users WHERE UserID="'.addslashes($a->getUsername()).'"'; -Jason Garber IonZoft.com At 10:49 PM 12/8/2001 +0000, Simon H wrote: >Can anyone explain to me why this wont work, or if there is another way to >use the (logged on) users Username in a query: > >$UserDetailsSQL = 'SELECT * FROM users WHERE UserID = $a->getUsername()'; > >I've tried every alternative my limited brain can think of using quotes, %s, >etc, and still no luck. > >Thanks > >Simon H > > >-- >PEAR General Mailing List (http://pear.php.net/) >To unsubscribe, e-mail: pear-general-unsubscribe@lists.php.net >For additional commands, e-mail: pear-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.pear.general (#589) next »