title: How do I skip empty result or errors in this loop?
body: <p>I do have a loop which store data into mysql...</p>
  
  <pre><code>/connect to your database 
  //read your text file into an array, one entry per line
  
  $lines = file('name.txt'); 
  
  //loop through each website URL you read from the file 
  foreach ($lines as $name) { 
  
  //do some code
  //Insert data to MySQL
   mysql_query("INSERT INTO table (data1,data2) VALUES ('$data1','$data2')");
  
  } 
  </code></pre>
  
  <p>My problem is when the code returns empty..then it gives error and stop...so how can I skip this and continue to next name so loop wont stop until it finished?</p>