Bluehost.com Web Hosting $6.95

Re: [PHP] Re: Update db with $_POST

This is a discussion on Re: [PHP] Re: Update db with $_POST within the PHP General forums, part of the PHP Programming Forums category; On Tue, 2005-03-15 at 18:45 -0500, Jason Barnett wrote: > Danny Brow wrote: > > Thanks for ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-16-2005
Danny Brow
 
Posts: n/a
Default Re: [PHP] Re: Update db with $_POST

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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0