Reply to RE: Update db with $_POST

Your name:

Reply:


Posted by Danny Brow on 03/16/05 01:26

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']));






>I'm trying to update some form data with this db update query and it's
>not working, I'm not getting an error either.

>$db->query("UPDATE items SET item_name = $_POST[title], item_desc =
>$_POST[description], item_price = $_POST[price], extraprice =
>$_POST[extraprice] WHERE item_id = 3");

>&

>I've tried this:

>$db->query("UPDATE items SET (item_name, item_desc, item_price,
>extraprice)
> VALUES (?,?,?,?) WHERE item_id = 3",
> array($_POST['title'], $_POST['description'], $_POST['price'],
>$_POST['extraprice']));

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация