Advertisement:

Author Topic: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax  (Read 209 times)

Offline Jarppi

  • Semi-Newbie
  • *
  • Posts: 26
Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
« 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

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,434
    • sbulen on GitHub
Re: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
« Reply #1 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: 
Code: [Select]
// Update the board tables.
foreach ($board_updates as $profile => $boards)
{
if (empty($boards))
continue;

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

To:
Code: [Select]
// 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. ***
« Last Edit: September 09, 2019, 01:40:15 PM by shawnb61 »
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Jarppi

  • Semi-Newbie
  • *
  • Posts: 26
Re: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
« Reply #2 on: September 09, 2019, 02:23:57 PM »
Awesome! That did the trick!
Thank you!

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,434
    • sbulen on GitHub
Re: Upgrade 1.1.21 -> 2.0.15 error in your SQL syntax
« Reply #3 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.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp