Re: Re: Update db with $_POST

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

 



On Tue, 2005-03-15 at 18:45 -0500, Jason Barnett wrote:
> Danny Brow wrote:
> > Thanks for looking,
> >
> > I figured it out, after RTFM for db, I found that I needed to do field=? instead of using VALUES ().
> >
> >
> >
> > Example:
> >
> > $db->query('UPDATE items SET item_name=?, item_desc=?, item_price=?, extraprice=? WHERE item_id = 3',
> >             array($_POST['title'], $_POST['description'], $_POST['price'], $_POST['extraprice']));
> >
> 
> FYI - You should at least escape the $_POST data (more filtering may be
> necessary) before you go inserting it into your database.  When using
> raw $_POST data it may be possible for someone to DROP DATABASE.

I was planning on this, but I like to get things working first then move
on to cleaning the input up. I'm still learning the db stuff, so the
less that can cause an issue the better.

Thanks,
Dan.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux