Hi,
I am trying to create add a json object (variable names => variable values) to an sql database.
So heres what I would need
1) Take various inputs from webpage (done)
2) Send as json encoded object to php script using rawXhrPost (done)
3) Use php script to create the new entry in my database table without having to list out the field names, field values (stuck here)
4) Return the created item from db with the primary key which my page will use (shouldn't be a problem).
So below you can see the part of my php script that I am working on, with the dotted areas being the part I would hope to make simpler somehow.
$input=file_get_contents('php://input', 1000000);
$values=$json->decode($input);
$obj=mysql_query["INSERT INTO comment .......... values ..........
echo $json->encode($obj);