title: compare value in mysqli query
body: <p>I have one table called <strong>tbl_favorite</strong>. there two field called <strong>user_id</strong> and <strong>quote_id</strong>. I am passing this both field in parameter. I want check that <strong>user_id</strong> have any row with that <strong>quote_id</strong>. if its exist I want response like "already exist" else I want insert that data in table.</p>
  
  <pre><code>    &lt;?php
  header('Content-Type: application/json; Charset=UTF-8');
  include("dbconnection.php");
  $userid= $_GET['userid'];
  $quoteid= $_GET['quoteid'];
  
  // I am confused to write condition
  $query= mysqli_query($conn,"SELECT fav_id FROM tbl_fav  WHERE  user_id='".$userid.'" AND fav_qu_id="'.$quoteid.'"");
  
  if(mysqli_num_rows($query) &gt; 0){
  
  $response="already exist";
  
  }
  else{
  $query= mysqli_query($conn,"INSERT INTO tbl_fav(user_id,fav_qu_id VALUE('".$userid."','".$quoteid."')");
  $response['message']='success';
  
  }
  echo json_encode($response);
  ?&gt;
  </code></pre>
  
  <p>my url is like below</p>
  
  <pre><code>example.com/api.php?user_id=1&amp;&amp;quote_id=1
  </code></pre>
  
  <p>I am getting error called Parse error: syntax error, unexpected '"'. Let me know if someone correct me. I am android developer and does not know proper PHP. Thanks</p>