How to insert JSON values into MySQL using PHP for an API creation? -


i have following json values:

[newcomposemail={"msg":"test mail","senderuserid":"1006","subject":"test","to":"10002"}, composemail] 

my query is:

 insert `push_msg_table`(`pid`, `subject`, `msg`, `sentuserid`, `sent_time`, `upload_path`, `status`) values() 

i need insert these values mysql table. new json.

try use in php

json_decode(newcomposeemail,true); 

adding true proper array else return object in php

if there multiple entries in json , have loop through json array, in order insert multiple entries in db


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -