title: Function returning false negative
body: <p>I am saving the gamestate from a mobile game on a MySql database. The information is successfully saved, however it is echoing that there was an error in saving the game state. I'm still adjusting to php and not sure where this is coming from. </p>
  
  <p>PS I know the SQL statement is insecure. Right now I'm just getting the fundamentals up and running as the statements and tables themselves will change soon. </p>
  
  <p>Listining for incoming json:</p>
  
  <pre><code>    } else if ($tag == 'save_game_state') {
      $email = $_POST['email'];
      $virtumon = $_POST['monster'];
      $qty = $_POST['qty'];
      $exp = $_POST['exp'];
      $user = $db-&gt;saveGameState($email, $monster, $qty, $exp);
          if ($user) {
              $response["success"] = 1;
              $response["The game state has been successfully saved"];
           echo json_encode($response);
          } else {
              // user failed to store
              $response["error"] = 1;
              $response["error_msg"] = "Error occured in saving the game state";
              echo json_encode($response);
          }
  </code></pre>
  
  <p>Inputting the information into the DB and returning success/failure. </p>
  
  <pre><code>    public function saveGameState($email, $monster, $qty, $exp) {
  
      $result = mysql_query("INSERT INTO user_profiles(email, monster, qty, exp) VALUES('$email', '$monster', '$qty', '$exp')") or die(mysql_error());
      // TODO check for successful store
      $success = mysql_query("SELECT email, monster, qty, exp FROM user_profiles WHERE email = '$email' AND monster= '$monster' AND qty = '$qty' AND exp = '$exp'");
     if ($success) {
              return mysql_fetch_array($success);
      } else {
         return false;
     }
  }
  </code></pre>