note 25669 added to ref.mysql
| From: | varga dot zoltan at freechat dot hu | Date: | Tue, 01 Oct 2002 22:42:46 +0000 |
| Subject: | note 25669 added to ref.mysql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37490@lists.php.net to get a copy of this message | ||
Here is the code to load a mysql dump file into mysql database:
$odump=file($temp["db"]);
$dump="";
foreach ($odump as $line) {
if (trim($line)!='' && substr(trim($line),0,2)!='--') {
$dump.=trim($line);
}
$tables=explode(';',$dump);
foreach ($tables as $sql) {
mysql_query($sql);
print mysql_error();
}
--
http://www.php.net/manual/en/ref.mysql.php
http://master.php.net/manage/user-notes.php?action=edit+25669
http://master.php.net/manage/user-notes.php?action=delete+25669
http://master.php.net/manage/user-notes.php?action=reject+25669