I am getting this error:
Invalid DATA LOAD query
here is a sample of the text in the text file:
steve,123-456-0000
Here is all my code:
MySQL database User ID, Password and DB name
$database_login="";
$database_pass="";
$database_host="localhost";
$database_name="";
$db=mysql_pconnect($database_host,$database_login,$database_pass);
mysql_select_db($database_name,$db);
Load local comma separated, fields enclosed by quotes text database - File has to be in the same directory of this file
$result = mysql_db_query('$database_login',"LOAD DATA INFILE 'test.txt' INTO TABLE news (user,phone) FIELDS TERMINATED BY ','") or die ("Invalid DATA LOAD query");
I would also like to automatically with each import, put a category # in. We have different user classes. I will have multiple text files for each class. (user,phone, cat_id=4)
Can i do something like that? it is not possible to add the cat_id into the text file.
Please help guys,
Thanks