Notice: Undefined index: Tables_in_* in /usr/home/*/public_html/store/admin/model/tool/backup.php on line 21Notice: Undefined index: Tables_in_* in /usr/home/*/public_html/store/admin/model/tool/backup.php on line 22
When men become mice then are mice just as good as men?
Which version of OpenCart are you using? Have you checked the error log for more information?
The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."
I fixed it by changing the below function from the new version back to an old version.
New version
public function getTables() {
$table_data = array();
$query = $this->db->query("SHOW TABLES FROM `" . DB_DATABASE . "`");
foreach ($query->rows as $result) {
if (substr($result['Tables_in_' . strtolower(DB_DATABASE)], 0, strlen(DB_PREFIX)) == DB_PREFIX) {
$table_data[] = $result['Tables_in_' . strtolower(DB_DATABASE)];
}
}
return $table_data;
}
Old version:
public function getTables() {
$table_data = array();
$query = $this->db->query("SHOW TABLES FROM `" . DB_DATABASE . "`");
foreach ($query->rows as $result) {
$table_data[] = $result['Tables_in_' . DB_DATABASE];
}
return $table_data;
}
If there is some problem, please advise.
New version
public function getTables() {
$table_data = array();
$query = $this->db->query("SHOW TABLES FROM `" . DB_DATABASE . "`");
foreach ($query->rows as $result) {
if (substr($result['Tables_in_' . strtolower(DB_DATABASE)], 0, strlen(DB_PREFIX)) == DB_PREFIX) {
$table_data[] = $result['Tables_in_' . strtolower(DB_DATABASE)];
}
}
return $table_data;
}
Old version:
public function getTables() {
$table_data = array();
$query = $this->db->query("SHOW TABLES FROM `" . DB_DATABASE . "`");
foreach ($query->rows as $result) {
$table_data[] = $result['Tables_in_' . DB_DATABASE];
}
return $table_data;
}
If there is some problem, please advise.
This is also true in OpenCart 3 (in 2018) - to avoid the error messages when trying to do your first backup you need to have your data file name all in lower case - opencartdatafile not OpenCartDataFile, and then fix your config.php files in both /catalog and /catalog/admin respectively.
Who is online
Users browsing this forum: No registered users and 34 guests