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
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-09-2009, 04:12 PM   #1 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default SQL Import

Alright, I am working on an installation script and I am having some issues. I have a .sql file that I want to run with php and import it to my database and suggestions?

Thanks,
Randy
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
Old 12-11-2009, 11:15 PM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Depending on the size of the database schema you are using, you could save yourself a tiny bit of overhead by simply hard coding it into the installation script (or even turning your sql dump into a big heredoc and require() or include() it). Alternatively you should look into PHPs file handling functions, such as file() or file_get_contents().

(I would have provided links to each function, but I'm in a hospitable room on a laptop and I hate laptops)
delayedinsanity is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Injection and mysql_real_escape_string Durux General 61 01-29-2013 12:20 PM
how can we migrate sql server database to my sql boreddy MySQL & Databases 1 06-11-2009 09:19 AM
Importing an SQL dump via PHP delayedinsanity MySQL & Databases 1 07-21-2008 05:59 PM
SQL injections protection Rendair Tips & Tricks 23 12-11-2007 03:59 PM
Export as SQL from mySQL using cron job datahound MySQL & Databases 5 12-08-2007 12:18 AM


All times are GMT. The time now is 03:57 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design