mysql_close(); } else { $error_info = mysql_errno() . " : " . mysql_error() . "<br>"; $db_error = true; break; } } else { $sqldump = null; $conn = $db->connect($dbname, $dbhost, $dbuser, $dbpasswd); if ($version > '4.1' && $charset) { $db->query($set_names); } if ($version > '5.0') { $db->query($set_modes); } $tables = $db->table_names(); if (!empty($tables)) { foreach ($tables as $names) { if (!function_exists("stripos")) { function stripos($str, $needle) { return strpos(strtolower($str), strtolower($needle)); } } if (stripos($names['table_name'], $tb_prefix) === 0) { $sqldump .= data2sql($names['table_name']); } } pb_create_folder(PHPB2B_ROOT . DS . "data" . DS . "backup_" . $backupdir); $file_path = PHPB2B_ROOT . DS . "data" . DS . "backup_" . $backupdir . DS . date('ymd') . '_' . pb_radom() . ".sql"; if (trim($sqldump)) {