A get in my PHP script JSON string that looks like this (array with any objects):
[
{
\"source\":\"symbols/2/2.png\",
\"ypos\":133,
Try this:
$value) {
if($value) {
//how to use json array to insert data in Database
mysql_query("INSERT INTO tablename (source, ypos, template) VALUES ($value->source, $value->ypos,$value->template)");
}
mysql_close($con);
}
Note: But it is recommended to use PHP Data Objects(PDO) to do database operations. Check here