so I have a simple code to post data to database
<?php
$data = json_decode(file_get_contents("php://input"));
$review = mysql_real_escape_string($data->review);
mysql_connect("localhost", "root", "");
mysql_select_db("reherse");
mysql_query("INSERT INTO reviews('review') VALUES('".$review."')");
?>
But it's getting me to an error 'Trying to get property of non-object'. I'm new in PHP so It might be some stupid mistake.