RE: [PHP] MySQL Query
| From: | Ford, Mike [LSS] | Date: | Mon, 30 Jun 2003 18:18:33 +0000 |
| Subject: | RE: [PHP] MySQL Query | ||
| Groups: | php.general php.general | ||
| Request: | Send a blank email to php-general+get-153523@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Pushpinder Singh Garcha [mailto:pgarcha@adelphia.net]
> Sent: 30 June 2003 19:10
>
> Can someone tell me what is wrong with the following querys ? I am
> pretty sure its got something to do with the quotes around $_POST[]
> variables.
>
> $sql1 = "SELECT * from
admin where
> admin.user =
> '"$_POST['validuser']"' AND
> admin.pwd =
> '"$_POST['password']"'";
>
> $sql1 = "SELECT * from admin where user =
> "$_POST['validuser']" AND
> pwd = "$_POST['pass']"";
Too many quotes, not enough curly braces:
$sql1 = "SELECT * from admin where user =
'{$_POST['validuser']}' AND
pwd = '{$_POST['pass']}'";
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211