So I have the file db.sql, and its only a few kilobytes, so very small, but I can't figure out how I would import it in to my database through a PHP script. I tried some code that broke it up query by query but it did not get fully imported.
use phpMyAdmin. It should be available from your control panel.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
I managed to load a CSV file into MySQL really easily with this so it might be your way forward. That said someone who knows their stuff might dive in with something better... either way I hope this has been of some use!
Regards,
Leonard
PS... The query string I used was...
"LOAD DATA LOCAL INFILE './$filename' INTO TABLE $dbtable FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'"
Last edited by Gentleman_; 12-16-2008 at 03:58 PM..
Looking in the comment on the php manual, I've seen this: http://www.php.net/manual/en/functio...uery.php#85876
As far as I know, it reads the sql file and sends the query one after the other, but should be able to cope with multilines statements.
It could be worth a try.
__________________
Only a biker knows why a dog sticks his head out the window.
just put the queries into strings and call them with mysql_query($command_string)
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?