Jump to content

Need some help with MySQL 5.0 query


alexszilagyi

Recommended Posts

Hi there!,

 

I have a query that I think it is written in the 5th version of MySQL and my web server has only the 4th one. Actually it is a plugin for CB Builder [Joomla 1.5]. The plugin is called CB Profile Flags and here is the query code[related to this error]:

 

            <query>
                SET @statefieldid=(SELECT fieldid FROM `#__comprofiler_fields` WHERE `name`='cb_state');
            </query>

and

            <query>
                SET @deletefieldid=(SELECT fieldid FROM `#__comprofiler_fields` WHERE `name`='cb_state');
            </query>

 

Can anybody help me to write the query to be compatible with the 4th version of MySQL? By the way here is the error which returns me when I'm trying to install it:

 

SQL Error DB function failed with error number 1064

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 'SELECT fieldid FROM `jos_comprofiler_fields` WHERE `name`='cb_s SQL=SET @statefieldid=(SELECT fieldid FROM `jos_comprofiler_fields` WHERE `name`='cb_state');

SQL =

 

SET @statefieldid=(SELECT fieldid FROM `jos_comprofiler_fields` WHERE `name`='cb_state');

 

Thank you very much!

Link to comment
https://forums.phpfreaks.com/topic/159772-need-some-help-with-mysql-50-query/
Share on other sites

  • 1 month later...

Yep, it works

 

Thank you very much!!!!

 

Well the queries should be

SELECT @statefieldid:=fieldid FROM `#__comprofiler_fields` WHERE `name`='cb_state';

&

SELECT @statefieldid:=fieldid FROM `#__comprofiler_fields` WHERE `name`='cb_country';

 

 

Thanks again!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.