MyBB Community Forums

Full Version: SQL error while importing database - Pls help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys, I have changed host recently.


I Uploaded the whole files backup & then while importing the database backup in phpmyadmin, I get the following error :

INSERT INTO mybb_ems( eid, message,
TYPE ,
INDEX , author, created,
ORDER )
VALUES (
'1', 'Pls Welcome our new Admin - Spirit & our new mod - sweet_nanny', 'blue', '1', '1', '1238172966', '1'
);

MySQL said: Documentation
#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 'index,author,created,order) VALUES ('1','Pls Welcome our new Admin - Spirit & ou' at line 1

Pls help quickly. Thanks.
You need to have the values single quoted. Especially anything that might be a mysql command such as ORDER and maybe INDEX too. You might have to open the file in a text edit and do some search and replacing.


INSERT INTO mybb_ems( eid, message,TYPE ,INDEX , author, created,ORDER )

Should be

INSERT INTO mybb_ems( 'eid', 'message','TYPE' ,'INDEX' , 'author', 'created','ORDER' )

I haven't reported this as an official bug yet but maybe I should. The mybb export can be broken if any custom plugins have a field like that. Authors need to be aware but Mybb backup should single quote the variables anyways.
I searched the backup file in my text editor & the line is this:


INSERT INTO mybb_ems (eid,message,type,index,author,created,order) VALUES ('1','Pls Welcome our new Admin - Spirit & our new mod - sweet_nanny','blue','1','1','1238172966','1');

What shud I change in this?
Do a text search and replace in a text edit..

Search for

eid,message,type,index,author,created,order

Replace with

'eid','message','type','index','author','created','order'
Sorry, still the error is showing, any other way to solve this?
The error is probably different now or you screwed up the replace.