mirror of
https://github.com/zyx0814/dzzoffice.git
synced 2025-01-08 11:57:57 +08:00
修复数据库备份报错
This commit is contained in:
parent
4b9523e474
commit
0d03a65d32
@ -66,12 +66,11 @@ if ($operation == 'export') {
|
||||
$tables = C::t('setting') -> fetch('custombackup', true);
|
||||
} else {
|
||||
C::t('setting') -> update('custombackup', empty($_GET['customtables']) ? '' : $_GET['customtables']);
|
||||
$tables = &$_GET['customtables'];
|
||||
$tables = $_GET['customtables'];
|
||||
}
|
||||
|
||||
//验证表名是否正确
|
||||
foreach($tables as $key => $table){
|
||||
if(!in_array($table,$alltabls)) unset($tables[$key]);
|
||||
if(!in_array($table,$alltables)) unset($tables[$key]);
|
||||
}
|
||||
if (!is_array($tables) || empty($tables)) {
|
||||
showmessage('database_export_custom_invalid');
|
||||
@ -540,7 +539,7 @@ function sqldumptable($table, $startfrom = 0, $currsize = 0) {
|
||||
if ($_GET['extendins'] == '0') {
|
||||
while ($currsize + strlen($tabledump) + 500 < $_GET['sizelimit'] * 1000 && $numrows == $offset) {
|
||||
if ($firstfield['Extra'] == 'auto_increment') {
|
||||
$selectsql = "SELECT * FROM $table WHERE$firstfield['Field']> $startfrom ORDER BY$firstfield['Field']LIMIT $offset";
|
||||
$selectsql = "SELECT * FROM $table WHERE ".$firstfield['Field']." > ".$startfrom." ORDER BY ".$firstfield['Field']." LIMIT " .$offset;
|
||||
} else {
|
||||
$selectsql = "SELECT * FROM $table LIMIT $startfrom, $offset";
|
||||
}
|
||||
@ -571,7 +570,8 @@ function sqldumptable($table, $startfrom = 0, $currsize = 0) {
|
||||
} else {
|
||||
while ($currsize + strlen($tabledump) + 500 < $_GET['sizelimit'] * 1000 && $numrows == $offset) {
|
||||
if ($firstfield['Extra'] == 'auto_increment') {
|
||||
$selectsql = "SELECT * FROM $table WHERE$firstfield['Field']> $startfrom LIMIT $offset";
|
||||
|
||||
$selectsql = "SELECT * FROM $table WHERE ".$firstfield['Field']." > ".$startfrom." LIMIT " .$offset;
|
||||
} else {
|
||||
$selectsql = "SELECT * FROM $table LIMIT $startfrom, $offset";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user