note 25669 deleted from ref.mysql by didou
| From: | didou@php.net | Date: | Sat, 17 May 2003 17:37:51 +0000 |
| Subject: | note 25669 deleted from ref.mysql by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48188@lists.php.net to get a copy of this message | ||
Note Submitter: varga.zoltan@freechat.hu
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();
}