I am reading a text file, which is a comma separated database. The first line in uncontrollably a list of column names which I do not want to read and put into the database. The last line is a blank line when I open it in notepad it has a space character in on it and that is all. I am using a script to read the lines one by one and input them into a database via sql. I need to not read this last line as it will set all my variables to nothing since theres nothing in the line, but i need to read what one of the variables on the last line was. How can I simply skip inputting the first and last lines? I dunno what the last line # will be as the length varies. [code]$fp = fopen($destination."".$file['name'],'r'); if (!$fp) {echo 'ERROR: Unable to open file '.$file['name']; exit;} while (!feof($fp)) { $mydate = gmdate('Y-m-d H:i:s'); if ($newline != "") { $line = fgets($fp, 1024); list ($price,$volRemaining,$typeID,$range,$orderID,$volEntered,$minVolume,$bid,$issued,$duration,$stationID,$regionID,$solarSystemID,$jumps) = split (',', $line); if($price != "price" || $price != "") { $fileinsertquery = "INSERT INTO marketData (price,volRemaining,typeID,range,orderID,volEntered,minVolume,bid,issued,duration,stationID,regionID,solarSystemID,lastUpdated) VALUES ($price,$volRemaining,$typeID,$range,$orderID,$volEntered,$minVolume,$bid,$issued,$duration,$stationID,$regionID,$solarSystemID,\"$mydate\")"; $result = mysql_query($fileinsertquery); $fp++; } } } fclose($fp);[/code]