I do have a loop which store data into mysql…
/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')");
}
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?
If all you you want to do is check for an empty line, this will do that.
Good luck!