Backup mysql

Hello,

If the table row is not available, else like, How can I do?

Can you help?

Sample
while ($row = $result->fetch_row()) {


}else{
fwrite($handle, $return);
unset($return);
}

[php]
foreach ($tables as $table) {

$result     = $mysqlibag->query('SELECT * FROM ' . $table);
$num_fields = $result->field_count;

$return .= 'DROP TABLE IF EXISTS ' . $table . ';';
$row2 = $mysqlibag->query('SHOW CREATE TABLE ' . $table)->fetch_row();
$return .= "\n" . $row2[1] . ";\n";

// YEDEKLENEN DOSYA ADI VE DOSYAYA YAZMA KOD BURADA
$handle = fopen('tarih-' .$table . $yedekleme_tarihi . '.sql', 'a');

for ($i = 0; $i < $num_fields; $i++) {
    @set_time_limit(0);
    while ($row = $result->fetch_row()) {
        $return .= 'INSERT INTO `' . trim($table) . '` VALUES(';
        for ($j = 0; $j < $num_fields; $j++) {
            $row[$j] = addslashes($row[$j]);
            $row[$j] = preg_replace("/\r\n/", "\\r\\n", $row[$j]);
            if (isset($row[$j])) {
                $return .= "'" . $row[$j] . "'";
            } else {
                $return .= "''";
            }
            if ($j < ($num_fields - 1)) {
                $return .= ',';
            }
        }
        $return .= ");\n";
        fwrite($handle, $return);
        unset($return);
    }

}

fclose($handle);

}
[/php]

Thanks

Work I did this manner, but is it true?

$roww = $result->fetch_row();
if(!$roww[0]){
fwrite($handle, $return);
unset($return);
}

Sponsor our Newsletter | Privacy Policy | Terms of Service