so something like...
exec("mysql -e \"source file.sql" db_name");
I think I get a general idea of what you are saying..
Would you say it would be better to forgo the formatting to .sql and keep the comma delimited text file and load it into the database using LOAD DATA?
If that is the case what would be the best way to go about doing this?
My text file is in this format
A,000037 ,7398,MICROSOFT PRESS SPECIAL ,INTERNET INFORMATION SVCS ,5.0 DOCUMENTATION ,0000000000000049.99,0-7356-0652-8 ,000003.34,0790145065285,0009.25,0007.50,0002.00, ,0000000000000023.94,S,N, ,N,NMS ,BOOK,4035,Y,N,
A,000038 ,7398,MICROSOFT PRESS SPECIAL ,PROGRAMMING ADO , ,0000000000000049.99,0-7356-0764-8 ,000001.83,0790145076489,0009.25,0007.50,0001.25, ,0000000000000023.94,S,N, ,N,NMS ,BOOK,4045,Y,N,
would something like
$load_file = "LOAD DATA INFILE 'file.txt' INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'";
work for what I am trying to do?
Thanks for input guys.. really appreciate it!
Cheers,
John