MyBB Community Forums

Full Version: MySQL Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Alright, I'm stupid. I was trying to truncate the section for usertitles in my MyBB database, and I accidentally truncated mybb_users. I'm assuming there isn't anything I can do to fix this?

I have my backup file from yesterday, but I keep getting an error.

Quote:SQL query:

INSERT INTO mybb_adminviews( vid, uid, title,
TYPE , visibility,
FIELDS , conditions, sortby, sortorder, perpage, view_type )
VALUES (
'1', '0', 'All Users', 'user', '2', 'a:7:{i:0;s:6:\"avatar\";i:1;s:8:\"username\";i:2;s:5:\"email\";i:3;s:7:\"regdate\";i:4;s:10:\"lastactive\";i:5;s:7:\"postnum\";i:6;s:8:\"controls\";}', 'a:0:{}', 'username', 'asc', '20', 'card'
);

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 'fields,conditions,sortby,sortorder,perpage,view_type) VALUES ('1

Can you guys help me out, or do I have to start my forum over? Sad
This is because sortby and sortorder are not quoted. Go into your sql file and do a search and replace for each of them.

find: sortby
replace: 'sortby'
find: sortorder
replace: 'sortorder'

That should fix it. Some sql versions have an issue with a column name that's also a command if it's not quoted.

Mybb backup should be adding single quotes imho to these exports.
That didn't do it. Now I'm having this issue:

Quote:INSERT INTO mybb_adminsessions( sid, uid, loginkey, ip, dateline, lastactive,
DATA )
VALUES (
'156d2fd7eeb2bed0e6adc96ba5074aae', '1', 'ohsqMrnMkJzrRFezArEY8siKumx7AeNvr4Qcyw6SscpeQVjeEy', '71.222.1.93', '1242296526', '1242296562', 'a:2:{s:14:\"last_users_url\";s:87:\"index.php?module=user/users&search_id=bc61fd986e95c1eae4bfc3eada3fe2f1&username=bundyxc\";s:10:\"user_views\";a:1:{s:32:\"bc61fd986e95c1eae4bfc3eada3fe2f1\";a:11:{s:3:\"uid\";s:1:\"0\";s:5:\"title\";s:9:\"All Users\";s:4:\"type\";s:4:\"user\";s:10:\"visibility\";s:1:\"2\";s:6:\"fields\";a:7:{i:0;s:6:\"avatar\";i:1;s:8:\"username\";i:2;s:5:\"email\";i:3;s:7:\"regdate\";i:4;s:10:\"lastactive\";i:5;s:7:\"postnum\";i:6;s:8:\"controls\";}s:10:\"conditions\";a:1:{s:8:\"username\";s:7:\"bundyxc\";}s:6:\"'sortby '\";s:8:\"username\";s:9:\"'sortorder '\";s:3:\"asc\";s:7:\"perpage\";s:2:\"20\";s:9:\"view_type\";s:4:\"card\";s:3:\"url\";s:27:\"index.php?module=user/users\";}}}'
);

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 'sortby'\";s:8:\"username\";s:9:\"'sortorder'\";s:3:\"asc\";s:7:\