42 $this->prefix = $this->db->prefix .
'_';
54 $result = $this->db->queryF(
'SHOW TABLES');
55 while ($myrow = $this->db->fetchArray(
$result)) {
56 $value = array_values($myrow);
57 $value = substr($value[0], 5);
58 $tables[$value] = $value;
63 return join(
',', $tables);
78 $result = $this->db->queryF(
'SHOW create table `' . $table .
'`;');
80 if ($row = $this->db->fetchArray(
$result)) {
81 $sql_text .=
"# Table structure for table `" . $table .
"` \n\n";
83 $sql_text .=
"DROP TABLE IF EXISTS `" . $table .
"`;\n\n";
86 $sql_text .= $row[
'Create Table'] .
";\n\n";
89 $this->db->freeRecordSet(
$result);
90 $ret[
'sql_text'] = $sql_text;
91 $ret[
'structure'] = $verif;
105 $result = $this->db->queryF(
'SELECT * FROM ' . $table .
';');
107 $num_rows = $this->db->getRowsNum(
$result);
108 $num_fields = $this->db->getFieldsNum(
$result);
111 $field_type = array();
113 while (
$i < $num_fields) {
115 array_push($field_type, $meta->type);
119 $sql_text .=
"INSERT INTO `" . $table .
"` values\n";
121 while ($row = $this->db->fetchRow(
$result)) {
124 for (
$i = 0;
$i < $num_fields; ++
$i) {
125 if (is_null($row[
$i])) {
128 switch ($field_type[$i]) {
130 $sql_text .= $row[
$i];
133 $sql_text .=
"'" . mysql_real_escape_string($row[$i]) .
"'";
136 if ($i < $num_fields - 1) {
142 if (
$index < $num_rows - 1) {
152 $this->db->freeRecordSet(
$result);
153 $ret[
'sql_text'] = $sql_text .
"\n\n";
166 $file_name =
"dump_" . date(
"Y.m.d") .
"_" . date(
"H.i.s") .
".sql";
167 $path_file =
"../dump/" . $file_name;
168 if (file_put_contents($path_file, $sql_text)) {
173 $ret[
'file_name'] = $file_name;
174 $ret[
'write'] = $write;
dump_table_structure($table, $drop)
displayTables($array=true)