RE: [PHP] Why this doesn't work ?
| From: | Jim Moseby | Date: | Mon, 24 Oct 2005 17:50:11 +0000 |
| Subject: | RE: [PHP] Why this doesn't work ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224571@lists.php.net to get a copy of this message | ||
>
> Hi,
>
> > Make this line instead
> > $result = mysql_query($query) or die(mysql_error() . " with
> the query $query";
> > and you'll likely see the error.
>
> Here it goes:
>
> "You have an error in your SQL syntax; check the manual that
> corresponds
> to your MySQL server version for the right syntax to use near
> '(login)
> FROM formacao WHERE login = 'a'' at line 1"
>
Apparently, $login does not contain the text you think it does. Either echo
$login to see, or echo $query to see what is actually being passed to mysql.
JM