Jamit Software Forum

Jamit Job Board Customers => User-to-User Support => Topic started by: rutulo on May 08, 2011, 12:49:38 pm



Title: sql error
Post by: rutulo on May 08, 2011, 12:49:38 pm
I'm testing 3.6.10 in local (online I have 3.5), in every jobpost page I have at the end (after job description) the message error:

JB_mysql_query(SELECT t2.field_label AS FLABEL, t1.* AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='IT' AND section='1' AND form_id='1' ORDER BY field_sort ) - 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 'AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translati' at line 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translati' at line 1

Problem is on PHP 5.3, I don't have this problem in PHP 5.2

How to solve?  ???
thank's


Title: Re: sql error
Post by: wclang on May 08, 2011, 04:58:43 pm
I have the same problem on all of my test boxes when its run local. Its really odd. Older versions of Jamit never had this issue.


Title: Re: sql error
Post by: rutulo on May 08, 2011, 06:23:29 pm
I tested and problem is also with a new installation. I think problem is not full compatibility with PHP 5.3-
Someone has a solution?


Title: Re: sql error
Post by: Imran on May 09, 2011, 06:15:49 am
I'm using PHP 5.3 I don't see this error, also there are few errors in php 5.2, it is better to revert to php 5.2 I will try and revert back to php 5.2.


Title: Re: sql error
Post by: rutulo on May 09, 2011, 08:17:12 am
My problem in 5.2 is with XML export. I can export just last 1100 posts (I have 5.500...). Than I would like upgrade at 5.3-
I hope next version will be good with PHP 5.3


Title: Re: sql error
Post by: Imran on May 09, 2011, 08:59:02 am
There is a new Maintenance version released today Jamit 3.6.11 you should try and upgrade your version, make sure yu follow proper upgrade procedure.


Title: Re: sql error
Post by: rutulo on May 09, 2011, 09:44:42 am
Upgraded to 3.6.11 - but the problem is not solved  :(


Title: Re: sql error
Post by: dabesa on April 07, 2012, 09:04:12 pm
Hi guys,
I have the same error, it appear out of the blue on an installation that has work perfectly for months.
Maybe the hosting upgraded something, but the PHP is still v. 5.2.17.
Mysql server is 5.5.19, hosting is Hostgator.

The query:
        $sql = "SELECT t2.field_label AS FLABEL, t1.* AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='".JB_escape_sql($_SESSION['LANG'])."' AND section='".JB_escape_sql($section)."' AND form_id='".JB_escape_sql($form_id)."' ORDER BY field_sort  ";

is not valid and gives error.

Did anyone found a solution?

Thanks


Title: Re: sql error
Post by: dabesa on April 07, 2012, 10:09:31 pm
Hi guys,
I have the same error, it appear out of the blue on an installation that has work perfectly for months.
Maybe the hosting upgraded something, but the PHP is still v. 5.2.17.
Mysql server is 5.5.19, hosting is Hostgator.

The query:
        $sql = "SELECT t2.field_label AS FLABEL, t1.* AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='".JB_escape_sql($_SESSION['LANG'])."' AND section='".JB_escape_sql($section)."' AND form_id='".JB_escape_sql($form_id)."' ORDER BY field_sort  ";

is not valid and gives error.

Did anyone found a solution?

Thanks


UPDATE:
I found the cause was the " t1.* AS ID" part.
I solved just removing the "AS ID" and changing the query in dynamic_forms.php to:

        $sql = "SELECT t2.field_label AS FLABEL, t1.* AS ID, t2.field_comment AS FCOMMENT FROM form_fields AS t1, form_field_translations AS t2 WHERE t1.field_id=t2.field_id AND lang='".JB_escape_sql($_SESSION['LANG'])."' AND section='".JB_escape_sql($section)."' AND form_id='".JB_escape_sql($form_id)."' ORDER BY field_sort  ";


Everything works now, but I'm not sure if the AS ID part was used somehow, any input is appreciated.

I really think this happens after a mySql upgrade from Hostgator.



Title: Re: sql error
Post by: Imran on April 08, 2012, 01:53:22 am
I'm not sure about this error, how ever removing AS ID might cause some functionality to not work, there must be other work around for this what is the exact error code and error message you got earlier?


Title: Re: sql error
Post by: larryokonji on April 16, 2012, 04:29:16 pm
Hello,

Please I am having the same problem, dabesa did this solution work well for you
Or Imram do you have any other workaroud?


Title: Re: sql error
Post by: Imran on April 18, 2012, 08:34:12 am
I'm also using php 5.3+ but I thankfully do not have this error.


Title: Re: sql error
Post by: larryokonji on April 26, 2012, 05:57:46 pm
I had to upgrade and it worked
Used upgrade method from https://www.jamit.com.au/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=238 (https://www.jamit.com.au/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=238)
hope this helps


Title: Re: sql error
Post by: dabesa on May 09, 2012, 01:04:58 pm
Hello,

Please I am having the same problem, dabesa did this solution work well for you
Or Imram do you have any other workaroud?

Sorry for not answering earlier!
I confirm that with the work around everything is still working.
And I checked the latest 3.6.1 code and the problem is not there anymore.

Cheers!