Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Jarppi on September 09, 2019, 12:57:51 PM

Title: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
Post by: Jarppi on September 09, 2019, 12:57:51 PM
Hello,

Trying to complete upgrade from 1.1.21 -> 2.0.15 and I get this:
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 'WHERE id_board IN (1,34)' at line 3

Any fix for this?

PHP Version   7.2.21
MySQL Version   5.7.27
Title: Re: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
Post by: shawnb61 on September 09, 2019, 01:26:54 PM
My first theory is that you somehow got a null value as a $profile. 

In the file upgrade_2-0.sql, ~line 1776, change: 
// Update the board tables.
foreach ($board_updates as $profile => $boards)
{
if (empty($boards))
continue;

$boards = implode(',', $boards);


To:
// Update the board tables.
foreach ($board_updates as $profile => $boards)
{
if (empty($boards) || empty($profile))
continue;

$boards = implode(',', $boards);


& let us know if this works!

*** Note php 7.2 is not officially supported at this time for 2.0.x.  If you can go back to 7.1 you should do so. ***
Title: Re: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
Post by: Jarppi on September 09, 2019, 02:23:57 PM
Awesome! That did the trick!
Thank you!
Title: Re: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
Post by: shawnb61 on September 09, 2019, 02:27:32 PM
Good to know.  I'm not sure what settings in 1.1 resulted in this condition, so I recommend auditing your boards & permissions closely after the upgrade. 

I'm flagging this as resolved.