title: php insert statement has correct arguments but insert is returning false
body: <p>Ok so my insert should be fine but is returning false, $quote holds value i have checked. and my database is <a href="http://i.stack.imgur.com/m15gD.png" rel="nofollow">here</a> Hope another pair of eyes can spot this. I have been using the same insert style for the other php files, works fine. But this one is tricky...issit because of the foreign keys?</p>
  
  <pre><code>    &lt;?php
  
  $quote = $_POST["quote"];
  require "init.php";
  
  $query = "INSERT INTO `quote`(`quote_description`) VALUES('".$quote."');";
  $result = mysqli_query($con,$query);
  
  
  //"INSERT INTO `quote`(`quote_description`) VALUES ('".$quote."');";
  
  if($result)
  {
      $response = array();
      $code = "submit_true";
      $message = "Quote success, Click Ok to continue";
      array_push($response,array("code"=&gt;$code,"message"=&gt;$message));
      echo json_encode(array("server_response"=&gt;$response));
  
  
  }
  
  else{
      $response = array();
      $code = "submit_false";
      $message = "Sorry, some server error occurred, please try again";
      array_push($response,array("code"=&gt;$code,"message"=&gt;$message));
      echo json_encode(array("server_response"=&gt;$response));
  
  
  }
  mysqli_close($con);
  
  ?&gt;
  </code></pre>
  
  <p>I am getting the following error after checking for errors:</p>
  
  <blockquote>
    <p>Cannot add or update a child row: a foreign key constraint fails (mydb.quote, CONSTRAINT fk_quote_user FOREIGN KEY (user_id) REFERENCES user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION)</p>
  </blockquote>