title: Cannot send data to create new product in database
body: <p>I'm trying to create PHP file for uploading data to create new product in database, but it has to be unique file for every database with the same structure.
  <br />
  Code edited by me looks like this (I don't know anything about PHP, I'm just trying to use codes from web to make app work with database) : </p>
  
  <pre><code>&lt;?php
      $response = array();
      if(isset($_POST['title']) &amp;&amp; isset($_POST['review']) &amp;&amp; isset($_POST['rating']) &amp;&amp; isset($_POST['database_name'])) {
  
          $title = $_POST['title'];
          $review = $_POST['review'];
          $rating = $_POST['rating'];
          $database_name = $_POST['database_name'];
  
          require_once __DIR__ . '/db_connect.php';
  
          $db = new DB_CONNECT();
  
          $result = mysql_query("INSERT INTO " . $database_name . "(title, review, rating VALUES('$title', '$review', '$rating')");
  
          if ($result) {
              $response["success"] = 1;
              $response["message"] = "Product successfully created.";
  
              // echoing JSON response
              echo json_encode($response);
          } else {
          $response["success"] = 0;
              $response["message"] = "Oops! An error occurred.";
  
          // echoing JSON response
              echo json_encode($response);
          }
  
      } else {
          $response["success"] = 0;
          $response["message"] = "Required field(s) is missing";
  
          // echoing JSON response
          echo json_encode($response);
      }
  ?&gt;
  </code></pre>
  
  <p>But it's not working, I have error which is called "Oops! An error occurred." and I'm sure that database is ok, cause I'm using the same variable to read data from MySQL and it's fully working, so I think that there is something with PHP code.</p>