TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 07-21-2008, 04:52 AM   #1 (permalink)
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default 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.
delayedinsanity is offline  
Reply With Quote
Old 07-21-2008, 06:59 PM   #2 (permalink)
The Contributor
 
Join Date: Mar 2005
Posts: 81
Thanks: 0
AlEast is on a distinguished road
Default

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
__________________
NEWEDGE Services, Inc. - Developers of ClientExec
AlEast is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:32 AM.

 
     

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