I am sending some values with AJAX POST to a PHP file: I know I am getting them because I can see the values sent in the console:
table=MENU&colid=MID&id=2&colname=STATUS&value=1
But for some strange reason when I insert them into the query string:
"UPDATE ".$_POST['table']." SET ".$_POST['colname']." = ".$_POST['value']."
WHERE ".$_POST['colid']." = ".$_POST['id'];
Value is empty when value = 1!!!
UPDATE MENU SET STATUS = '' WHERE MID = '2'
I solved the problem by changing the variable name value to val, has anybody experienced something similar? is value a keyword or reserved word?
Any thoughts? Thanks