MyBB Community Forums

Full Version: SQL Error 1064
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

My webhost recently upgraded the php to my website and that borked my forums. I figured an upgrade was due so I attempted the upgrade but ran into this error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'd: :rashad'd:' WHERE sid = "275"' at line 2
Query:
    UPDATE mybb_smilies SET `find`=':rashad'd: :rashad'd:' WHERE sid = "275" 

I'm not sure how to go about fixing this and getting the forums back up. I really dont want to lose em as theres 15 years of history there that id like to keep up.

Thanks for any help you can give.
Do you use a plugin for smilies ?
The quotes aren't escaped in the query.
I don't think so. It's been ten years since I've added any plug Ins and can't recall if that was one? I recall the smiley area just being what it was but I did have smilies on the quick reply? But now I can't get into my forums so not sure if I borked the whole thing.
(2024-11-06, 01:50 PM)Crazycat Wrote: [ -> ]Do you use a plugin for smilies ?
The quotes aren't escaped in the query.

It could also be line #1719 of install/resources/upgrade30.php:
			$db->update_query('smilies', array('find' => implode("\n", $find)), 'sid = "'.(int)$last_sid.'"');
where the problem is as you point out a lack of escaping. That line should probably instead be (untested but confirmed as syntactically valid):
			$db->update_query('smilies', array('find' => $db->escape_string(implode("\n", $find))), 'sid = "'.(int)$last_sid.'"');
I'll take a look asap ty

that fixed it but, after the upgrade going to in to admin CP i was hit with this error
Fatal error: Uncaught Error: Call to undefined method pluginSystem::run_hooks_by_ref() in /home/thecrypt/public_html/bb/admin/modules/blog/module_meta.php:23 Stack trace: #0 /home/thecrypt/public_html/bb/admin/index.php(752): blog_meta() #1 {main} thrown in /home/thecrypt/public_html/bb/admin/modules/blog/module_meta.php on line 23

and attempting to open the forum display
 Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/thecrypt/public_html/bb/inc/functions_forumlist.php(454) : eval()'d code on line 2

now the forum is displaying nothing
http://thecrypt.org/bb/
Bump for some help with this
(2024-11-06, 04:35 PM)vegathechosen Wrote: [ -> ]that fixed it but, after the upgrade going to in to admin CP i was hit with this error
Fatal error: Uncaught Error: Call to undefined method pluginSystem::run_hooks_by_ref() in /home/thecrypt/public_html/bb/admin/modules/blog/module_meta.php:23 Stack trace: #0 /home/thecrypt/public_html/bb/admin/index.php(752): blog_meta() #1 {main} thrown in /home/thecrypt/public_html/bb/admin/modules/blog/module_meta.php on line 23

The admin/modules/blog/ directory is not in core. Presumably, it's part of some sort of blogging plugin. If you can link us in to that plugin we can help you to get it working.

(2024-11-06, 04:35 PM)vegathechosen Wrote: [ -> ]and attempting to open the forum display
 Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/thecrypt/public_html/bb/inc/functions_forumlist.php(454) : eval()'d code on line 2

This seems to be due to a problem with one of your forumbit_depth[...] templates. Once the ACP is working again, you can investigate which one.
Thanks guys, gonna look in to it this evening!
I was able to get into the admin area, my forum still isnt displaying. I went to the plugin section and i was met with this error,

Fatal error: Cannot redeclare register_time_info() (previously declared in /home/thecrypt/public_html/bb/inc/plugins/register_time.php:13) in /home/thecrypt/public_html/bb/inc/plugins/1register_time.php on line 11
You have to remove old or unused plugins to fix that issues.