First, upload the backup files to the server one by one, pay attention to the evaluation of the volume label, and then perform the import operation.
// If you want to publish this article, please indicate the exit, no outgoing copyright notice, I do not like to see this kind of website. My work website does not indicate the person who is serving seven {see7di # gmail.com}
/*---------------------------------*/
Function _ doimport (){
$ F1 = _ r ($ _ Get ["f1"]);
// If it is the first loop
If ($ F1 = "1 "){
// Obtain the number of volumes first
For ($ I = 1; I I <1000; $ I ++ ){
If (file_exists ("./Cache/DB _". $ I. ". SQL ")){
Continue;
} Else {
$ _ Session ['_ num'] = ($ i-1 );
Break;
}
}
// Initialize the volume shard number
$ Fnum = 1;
} Else {
$ Fnum = _ r ($ _ Get ["fnum"]);
Settype ($ fnum, "integer ");
}
// Determine whether the process has ended
If ($ fnum> $ _ session ['_ num']) {
// Need to jump? Work = backdb delete user-uploaded backup files
Alert ("congratulations, all the backup files have been written to the database! \ N we recommend that you update the category cache and tag cache to ensure data correctness .","? Work = backdb ");
Die ();
}
$ Fp = file_get_contents ("./Cache/DB _". $ fnum. ". SQL ");
$ Fp = explode (';'. CHR (10), $ FP );
$ Fp = preg_replace ("/^ # (. *) \ n/is", "", $ FP );
// Echo "<textarea rows = '23' style = 'width: 100%; font-size: 12px; '> ";
Foreach ($ FP as $ key => $ Val ){
// Echo $ key. ":". trim ($ Val ). CHR (10 ). "====================================== ". CHR (10 );
Mysql_query (TRIM ($ Val ).";");
}
// Echo "</textarea> ";
Echo "<br> the system is restoring the database backup file dB _". $ fnum. ". SQL, please wait... <br> ";
Echo loading ($ fnum, $ _ session ['_ num']);
$ Fnum ++;
Alert ("","? Work = doimport & fnum = ". $ fnum ."");
}
The format of the SQL file to be imported depends on the format of volume-based export.