Problem with reading a file and inserting into table[Solved]
Posted: Thu Nov 06, 2003 3:15 pm
hello again
first, i want to thank everyone who has helped me through my learning process. lots of help has been provided and it's all done wonders. however, i have a new problem...
currently, my script is reading a file, and when it gets to line 4, it parses the data and assigns it to an array. i'm trying to dump that array into a table, but i'm having problems. here is the call
however, when i run this, it gives me this error message :
any help would be appreciated.
currently, my script is reading a file, and when it gets to line 4, it parses the data and assigns it to an array. i'm trying to dump that array into a table, but i'm having problems. here is the call
Code: Select all
<?php
elseif ($line_no > 4)
{
// Read column and update.
$info_data = preg_split("/[\s]+/", $line_data);
$qry="insert into TABLE loginfo values('".$info_data[0]."','".$info_data[1]."')";
mysql_query($qry) or die(mysql_error());
}
?>i've tried sitting it outside of the loop, but it has the same result ( except it only reads the last value that the array is assigned but still generates the same error).You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE loginfo values('213.111.11.14','2003-10-18')' at line 1
any help would be appreciated.