Re: Parse error: syntax error, unexpected T_ELSE
| From: | Daniel Brown | Date: | Wed, 16 Apr 2008 16:48:26 +0000 |
| Subject: | Re: Parse error: syntax error, unexpected T_ELSE | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44887@lists.php.net to get a copy of this message | ||
On Tue, Apr 15, 2008 at 5:56 PM, Javier Viegas <javiercviegas@gmail.com> wrote:
> Thanks Daniel i ´ve removed the unexpected else secction. Now it works but
> it tells me that there might be a syntax error on the query, this is good
> news because now i know i´m having connection with the database but also
> there must be something wrong with the query.
>
>
> $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id'];
[snip!]
You didn't enclose the value in quotes, that's all (and you should
sanitize the input --- NEVER accept data without sanitizing it
first!).
<?php
$del_str = "DELETE FROM libros WHERE
bnumero='".mysql_real_escape_string($_GET['Id'])."' LIMIT 1";
?>
--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!