when i try to insert each line into my oracle database i get an error stating invalid number, but if have only one line in the file it works fine.
$file = @fopen('file.text', "r") ;
// while there is another line to read in the file
while (!feof($file))
{
// Get the current line that the file is reading
$currentLine = fgets($file) ;
$currentLine = explode(' ',$currentLine) ;
insert($currentLine) ;
}
fclose($file) ;
the lines look like this
1 4 100
1 4 101
Your
explode()call is using 9 spaces as a separator, but your file only appears to have 5 spaces between each number. This means your$currentlinebe a single element array containing the original line, and not separate elements with a number in each.Either change the number of spaces in the explode call, or change to
which will split on any number of sequential spaces.