Re: Parse error: syntax error, unexpected T_ELSE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 15, 2008 at 5:56 PM, Javier Viegas <javiercviegas@xxxxxxxxx> 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!

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux