how to echo posted JSON data in php -


i trying display data in php echo not why displays nothing when it.

$data = json_decode(file_get_contents("php://input")); $code = mysql_real_escape_string($data->code); $name = mysql_real_escape_string($data->name);  mysql_connect("localhost", "root", "thanh03021986")  or die(mysql_error()); mysql_select_db("erp") or die(mysql_error());  echo $name; mysql_query("insert element(`code`, `name` ) values('".$code."','".$name."')"); 

it obvious $name has value when posted echo display nothing. also, how can convert php data use?


Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

SoapUI on windows 10 - high DPI/4K scaling issue -

java - why am i getting a "cannot resolve method" error on getApplication? -