You are here: Re: [PHP] Update db with $_POST « PHP « IT news, forums, messages
Re: [PHP] Update db with $_POST

Posted by Danny Brow on 03/16/05 10:12

On Wed, 2005-03-16 at 16:50 +1000, Ligaya Turmelle wrote:
> assuming you are using PEAR DB -
>
> $result =& $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']));
> if (PEAR::isError($result))
> {
> echo "Error: There was an error with the query. Message returned: ";
> die($result->getMessage().' '.$db->getUserInfo().' '));
> }


Thanks I got it worked out though, I'm going to try this also to see
what happens, I'm trying to learn the best I can and when things break
and you fix em you learn a lot more. Thanks again.

PS this is what I did:

$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've already posted this to the list, but it may not be there yet.

 

Navigation:

[Reply to this 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

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