Jump to content

[SOLVED] help with php and mysql


syntax101

Recommended Posts

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

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.