title: PHP / SQL Code not inserting data into database but no errors reported either
body: <p>I am having problems which the following code:</p>
  
  <pre><code>if(mysql_num_rows(mysql_query("SELECT user_id FROM myTable WHERE user_id = '$user_id'"))){
  
      mysql_query("UPDATE myTable SET
      id='',
      user_id='$user_id',
      title='$title',
      WHERE user_id='$user_id'
      ") 
  
  }  else {
  
      mysql_query("INSERT INTO myTable (id, user_id, title)
                   VALUES ('', $user_id, $title) ");
  }
  </code></pre>
  
  <p>The update part seems to work but after the else it doesn't insert the record into the table.</p>
  
  <p>Can anyone spot what could be the problem please?</p>