Re: [PHP] Update db with $_POST
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
[PHP] Update db with $_POST
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'])); Thanks, Dan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Update db with $_POST
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().' ')); } Should give you some info to tell you what is wrong. Danny Brow wrote: 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'])); Thanks, Dan. -- Respectfully, Ligaya Turmelle Life is a game so have fun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] update db
whats the php function that will let me update a db field? I've been looking at the manual but there seems to be no mention of it. ~kurth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]