Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Whats the PHP equivallent of mysql mydb somefile.sql
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 27th February 09:40
daevid@daevid.com (daevid
External User
 
Posts: 1
Default What's the PHP equivallent of "mysql mydb < somefile.sql"



Currently I run an 'updater' script to run through a directory of .sql files
using something like this in PHP:

$COMMAND = "mysql ".$OPTION['db_prefix'].$db." < ".$mydir.$filename;
system($COMMAND, $ret);

What would be the equivallent way to to this in a PHP mysql_query(""); way?

I see "LOAD", but that only works for data it seems.
http://dev.mysql.com/doc/refman/5.0/en/load-data.html

These scripts I use have ALTER statements and CREATE and all other types of
SQL in them and almost no data actually.

mySQL 5.0.15


ÐÆ5ÏÐ
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666