Project / Support Center
Welcome, Guest. Please login or register. December 11, 2019, 04:14: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  Open Source Topics  |  SMF related  |  Topic: Upgrade error 1.1.8 - ALTER TABLE smf_smileys ORDER BY LENGTH" error 0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: Upgrade error 1.1.8 - ALTER TABLE smf_smileys ORDER BY LENGTH" error  (Read 6211 times)
admin
Guest
« on: April 09, 2009, 02:13: AM »

How do I fix this "ALTER TABLE smf_smileys ORDER BY LENGTH" error I am getting?
While upgrading and possibly editing smileys in the Smileys section of your Administration Panel, you may get an error similar to this:

Quote

    This query:
    ALTER TABLE smf_smileys
    ORDER BY LENGTH(code) DESC;
    Caused the error:
    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 'LENGTH(code) DESC' at line 2


There are two solutions to resolve this error.

The first solution will fix both the issue with upgrading, as well as an issue with editing smileys in the Smileys and Message Icons section of your admin panel.
All you need to do is update your MySQL version. To update MySQL yourself, you will have to have server access. Otherwise, and more commonly the case, you will have to ask your host to upgrade MySQL on the server for you. It is unknown at the time if the MySQL AB Team is supporting this uasge or not.

There may be other versions of MySQL that have this issue as well, but upgrading MySQL to the latest version for the MySQL branch you are using may resolve the issue.

The second way to resolve this for upgrading is to open "upgrade_1-1.sql" with a text editor and find the following:
Code: [Select]
ALTER TABLE {$db_prefix}smileys
ORDER BY LENGTH(code) DESC;

Replacing this with:
Code: [Select]
ALTER TABLE {$db_prefix}smileys
ORDER BY code DESC;

For editing smileys in the Smileys and Message Icons section of your admin panel, open "/Sources/ManageSmileys.php" with a text editor and find the following code:
Code: [Select]
         // Sort all smiley codes for more accurate parsing (longest code first).
         db_query("
            ALTER TABLE {$db_prefix}smileys
            ORDER BY LENGTH(code) DESC", __FILE__, __LINE__);
Replacing this with:
Code: [Select]
         // Sort all smiley codes for more accurate parsing (longest code first).
         db_query("
            ALTER TABLE {$db_prefix}smileys
            ORDER BY code DESC", __FILE__, __LINE__);
This section of code will appear twice in "/Sources/ManageSmileys.php", You will find this approximatively on lines 654 and 990.
Report to moderator   Logged
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  Open Source Topics  |  SMF related  |  Topic: Upgrade error 1.1.8 - ALTER TABLE smf_smileys ORDER BY LENGTH" error « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!