rf9
07-17-2008, 11:05 AM
Hi, not sure if this should be in php or mysql forum but here it goes...
I have the following json data, that has been passed to a php file as a string via Ajax:
{"form_label": "First name", "form_type": "textfield", "form_validate": "no"},
{"form_label": "Last name", "form_type": "textfield", "form_validate": "no"} ];
I have then used json_decode which converts the string into an associative array.
I now want to insert this array data into mySQL, the data above would ideally create 2 rows in a table. Can anyone point me in the right direction, I know how to insert basic stuff to mySQL but this seems a bit trickier.
I have come across a few examples using mysql_insert_array function, anyone heard of this? it's not documented on php.net.
Any advice much appreciated.
Thanks
I have the following json data, that has been passed to a php file as a string via Ajax:
{"form_label": "First name", "form_type": "textfield", "form_validate": "no"},
{"form_label": "Last name", "form_type": "textfield", "form_validate": "no"} ];
I have then used json_decode which converts the string into an associative array.
I now want to insert this array data into mySQL, the data above would ideally create 2 rows in a table. Can anyone point me in the right direction, I know how to insert basic stuff to mySQL but this seems a bit trickier.
I have come across a few examples using mysql_insert_array function, anyone heard of this? it's not documented on php.net.
Any advice much appreciated.
Thanks