This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
70 Posts
6 months ago

Hi @ll,

One of my sites made with Seblod, since last update from 3.16.3 to 3.17.1, has an error. The site throws Error: 1064 and this message:

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 '' at line 3

After investigating I found the problem is with a small snippet that some fields have on Code BeforeRender field in order to retrieve some properties, e.g.:

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->where(('id')." = ".$fields['art_created_by']->value);
$fields['app_user']->form = '<input id="app_user" name="app_user" value="'.$db->loadResult().'" class="inputbox" type="hidden" />';

The problem is with some simple or double quote, probably in line 5 ($jquery->where()...) but I'm unable to solve it. Before the update that snippet was working perfectly. Maybe I'm missing something in the Seblod changelog...

Any help will be much appreciated

Best regards to all Sebloders


Get a Book for SEBLOD
4228 Posts
6 months ago
Level 1

Did you also update all additional plugins like above mentioned code pack? They all need to be updated with the Seblod update for compatibility.

70 Posts
6 months ago
Level 2

Hi Klas,

Yes, I forgot to mention that the plugins are also up to date,

pkg_cck_field_seblod_1.7.1 and

pkg_cck_field_code_1.6.0. All is up to date.

I can confirm the error is on line 5, in the clause where... But I don't know why the update affects that, and what is the misspelling... The code seems right

$query->where(('id')." = ".$fields['art_created_by']->value);<br>

if I change that for

$query->where(('id')." = 222");

it works... but obviously that's only for testing purposes...

EDIT: The problem seems to come from art_created_by, but I still don't understand why...

4228 Posts
6 months ago
Level 3

Try enclosing the value in quotes, could be it comes as string

$query->where(('id')." = '".$fields['art_created_by']->value . "'");
70 Posts
6 months ago
Level 4

Hi Klas,

You just save my day, my friday, my week and my ass

Thank you so much!

Get a VIP membership