syntax101 Posted December 14, 2007 Share Posted December 14, 2007 how do you add current value(inv_quantity) and $_POST(inv_quantity) using php and database(MySql) ex. inv_quantity <-Mysql $_POST(inv_quantity) <-php inv_quantity + $_POST(inv_quantity) Quote Link to comment https://forums.phpfreaks.com/topic/81665-solved-help-with-php-and-mysql/ Share on other sites More sharing options...
fenway Posted December 14, 2007 Share Posted December 14, 2007 Add them whre? when? Quote Link to comment https://forums.phpfreaks.com/topic/81665-solved-help-with-php-and-mysql/#findComment-414836 Share on other sites More sharing options...
june_c21 Posted December 14, 2007 Share Posted December 14, 2007 can you explain more clearly? Quote Link to comment https://forums.phpfreaks.com/topic/81665-solved-help-with-php-and-mysql/#findComment-414972 Share on other sites More sharing options...
syntax101 Posted December 15, 2007 Author Share Posted December 15, 2007 all i want is to add a value of inv_quantity(one of the field in my table) the value added to the inv_quantity comes from php a post = $_POST['inv_quantity'] ex add 2 to inv_quantity inv_quantity 2 RESULT: inv_quantity 4 Quote Link to comment https://forums.phpfreaks.com/topic/81665-solved-help-with-php-and-mysql/#findComment-415302 Share on other sites More sharing options...
syntax101 Posted December 15, 2007 Author Share Posted December 15, 2007 i already tested it in sql query and it works but when i transfer it to php it doesnt work code in phpmyadmin sql query 'UPDATE inventory SET inv_qcreated = inv_qcreated + 2 WHERE inv_num = 27' code: $sql='UPDATE inventory SET inv_qcreated = inv_qcreated + $_POST[inv_qcreated] WHERE inv_num = '$_POST['inv_num']; Quote Link to comment https://forums.phpfreaks.com/topic/81665-solved-help-with-php-and-mysql/#findComment-415310 Share on other sites More sharing options...
fenway Posted December 18, 2007 Share Posted December 18, 2007 That's becuase you need it in double-quotes... Quote Link to comment https://forums.phpfreaks.com/topic/81665-solved-help-with-php-and-mysql/#findComment-417327 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.