Post by Bioblaze » Sun Sep 18, 2011 4:09 am

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?


Newbie

Posts

Joined
Sun Jan 02, 2011 8:10 am
Location - Fresno, California

Post by Miguelito » Mon Sep 19, 2011 10:48 pm

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."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm

Post by redtao » Thu Sep 29, 2011 6:26 pm

I have the same problem and all the tables are not retrieved at backup.php. My versions is Version 1.5.1.2.
Thanks

Newbie

Posts

Joined
Wed Jun 08, 2011 8:21 am

Post by redtao » Thu Sep 29, 2011 6:39 pm

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.

Newbie

Posts

Joined
Wed Jun 08, 2011 8:21 am

Post by tsd » Sat Aug 18, 2012 6:48 pm

My solution was to change the name of the database to lowercase.

I've done this also in the files "config.php" folder and folder home admin on line:
"define ('DB_DATABASE', 'yourlowercasedatabasename');"

tsd
Newbie

Posts

Joined
Sat Aug 18, 2012 6:32 pm

Post by jrr » Fri Jun 29, 2018 4:32 am

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.

jrr
Active Member

Posts

Joined
Mon Nov 20, 2017 1:48 pm
Who is online

Users browsing this forum: No registered users and 34 guests