Re: Update db with $_POST

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

 



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.

-- 
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