gregwee Posted November 16, 2009 Share Posted November 16, 2009 When I try to do a database backup from Admin/Tools/Database Backup Manager, I get the following error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden' at line 1 select ID,UniqueID,Server,Password,User,Database,Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden Anyone has any idea what's the problem? I'm on MySQL version 5.0.67-log and using OsCommerce v2.2 RC2a Everything else in the store seems to be working fine. Link to comment Share on other sites More sharing options...
Jan Zonjee Posted November 16, 2009 Share Posted November 16, 2009 When I try to do a database backup from Admin/Tools/Database Backup Manager, I get the following error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden' at line 1 select ID,UniqueID,Server,Password,User,Database,Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden Database is a reserved word in MySQL 5.0. Should not be used as field name. Link to comment Share on other sites More sharing options...
gregwee Posted November 17, 2009 Author Share Posted November 17, 2009 Database is a reserved word in MySQL 5.0. Should not be used as field name. Thanks for the info. Doing a search of all the files under Admin, I found the following line in usersystem.lib.php, line 57, which is what I believe caused this error: $tag = "INSERT INTO sql_iden(UniqueID, Server, Password, User, `Database`, Timestamp, NoTimeout, IpLock, IP, Cookies, Data, Status) values(\"$UnID\", \"$Server\", \"$Password\", \"$Username\",\"$Database\", $Time, $use_time, $IpBlocker, \"$IP\", $CookieBlocker, \"$toTab\", $Status)"; It seems that this saves the session data. Even with this error, I found that the backup still seems to work, and will create the sql file in the backup directory. Browsing the database structure, it seems that the sql_iden table actually does have a column named "Database", which is really stupid since this is a reserve word. Shouldn't this be a bug fix as I'm sure I'm not the only one who experienced this problem? Link to comment Share on other sites More sharing options...
Jan Zonjee Posted November 17, 2009 Share Posted November 17, 2009 I found the following line in usersystem.lib.php, line 57, which is what I believe caused this error: $tag = "INSERT INTO sql_iden(UniqueID, Server, Password, User, `Database`, Timestamp, NoTimeout, IpLock, IP, Cookies, Data, Status) values(\"$UnID\", \"$Server\", \"$Password\", \"$Username\",\"$Database\", $Time, $use_time, $IpBlocker, \"$IP\", $CookieBlocker, \"$toTab\", $Status)"; It seems that this saves the session data. Even with this error, I found that the backup still seems to work, and will create the sql file in the backup directory. Browsing the database structure, it seems that the sql_iden table actually does have a column named "Database", which is really stupid since this is a reserve word. Shouldn't this be a bug fix as I'm sure I'm not the only one who experienced this problem? The file usersystem.lib.php is not part of osC, neither is the table sql_iden. Actually, osC does not (at least no longer) saves the contents of the session data in backups since it is useless to restore old data from that table. Link to comment Share on other sites More sharing options...
gregwee Posted November 18, 2009 Author Share Posted November 18, 2009 Thanks for the info. After doing a search as to where "usersystem.lib.php" is referenced, it looks like this is actually from MySQL Admin which I installed. I guess I'll just be using MySQL to do full backups instead of the backup manager on osCommerce. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.