TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   MySQL & Databases (http://www.talkphp.com/mysql-databases/)
-   -   Importing an SQL dump via PHP (http://www.talkphp.com/mysql-databases/3155-importing-sql-dump-via-php.html)

delayedinsanity 07-21-2008 03:52 AM

Importing an SQL dump via PHP
 
Does anybody have any suggestions on the best way to go about importing an SQL database dump via PHP?

The two obvious solutions so far:

1. Don't use an SQL dump, hardcode my queries into my script.

2. Strip my SQL dump down to just the CREATE commands, place some kind of delimiter between each one, read the file in with file_get_contents and then preg_split it based on the delimiter.

AlEast 07-21-2008 05:59 PM

Take a look at this tool for importing large dumps.. It was developed in PHP and depending on what it is you are looking for is GREAT time saver

BigDump: The Staggered MySQL Dump Importer


All times are GMT. The time now is 05:39 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0