Error 500 in JDatabaseMySQLi::query: 1064 when enter in a category!

Started by simbus82, April 07, 2012, 13:21:52 PM

Previous topic - Next topic

simbus82

Please help me! This error is returned!

Joomla 2.5.4
Virtuemart 2.0.2 (i'm really afraid to update a production site)
MySQL: 5.1.61-0+squeeze1
Apache/2.2.16
Php 5.3.3

It only occours when i'm logged-in, if i go to click a category in front end, i have this error!!!!

500 - JDatabaseMySQLi::query: 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 '' at line 1 SQL=SELECT cat.description FROM j17_categories cat WHERE cat.id=

I have serched in my joomla debug queries info and "SELECT cat.description FROM j17_categories" occours here


146. SELECT cat.description
  FROM j17_categories cat
  WHERE cat.id=


i have read a lot of this error around in the time, but i cannot figure what is the cause!!

In the query 146 i can see one error, there isn't the value after WHERE cat.id=.

Where i can find the code for this queries?

I have read that the cause could be a non configured category for products: every product in my site have a category, the manufactures too!


Here a queries list:

     SELECT `j17_virtuemart_categories_it_it`.* ,`j17_virtuemart_categories`.*
      FROM `j17_virtuemart_categories_it_it` JOIN j17_virtuemart_categories using (`virtuemart_category_id`)
      WHERE j17_virtuemart_categories_it_it.`virtuemart_category_id` = "9"
    SELECT `slug`
      FROM `j17_virtuemart_products_it_it`
      WHERE `virtuemart_product_id` = 187
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "218"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "219"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "220"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "221"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "222"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "223"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "224"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "226"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "225"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "227"
    SELECT `j17_virtuemart_medias`.*
      FROM `j17_virtuemart_medias`
      WHERE j17_virtuemart_medias.`virtuemart_media_id` = "228"
    SELECT DISTINCT l.`mf_name`,l.`virtuemart_manufacturer_id`
      FROM `j17_virtuemart_manufacturers_it_it` as l JOIN `j17_virtuemart_product_manufacturers` AS pm using (`virtuemart_manufacturer_id`)
      LEFT JOIN `j17_virtuemart_products` as p
      ON p.`virtuemart_product_id` = pm.`virtuemart_product_id`
      LEFT JOIN `j17_virtuemart_product_categories` as c
      ON c.`virtuemart_product_id` = pm.`virtuemart_product_id`
      WHERE p.`published` =1
      AND c.`virtuemart_category_id` =9
      ORDER BY l.`mf_name`
    SELECT `virtuemart_permgroup_id`,`group_name`,`group_level`
      FROM `j17_virtuemart_permgroups`
      ORDER BY `group_level`
    SELECT `perms`
      FROM j17_virtuemart_vmusers
      WHERE virtuemart_user_id="49"
    SELECT m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid
      FROM j17_modules AS m
      LEFT JOIN j17_modules_menu AS mm
      ON mm.moduleid = m.id
      LEFT JOIN j17_extensions AS e
      ON e.element = m.module
      AND e.client_id = m.client_id
      WHERE m.published = 1
      AND e.enabled = 1
      AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2012-04-07 10:51:23')
      AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2012-04-07 10:51:23')
      AND m.access IN (1,1,2,3)
      AND m.client_id = 0
      AND (mm.menuid = 131 OR mm.menuid <= 0)
      ORDER BY m.position, m.ordering
    SELECT cat.description
      FROM j17_categories cat
      WHERE cat.id=




Joomla! 2.5.16 & VM 2.0.24b

PRO


simbus82

Quote from: BanquetTables.pro on April 07, 2012, 13:46:19 PM
why are you using mysqli?

can you change it to mysql ?

mysqli is the deafut and preferred engine for Joomla 1.7/2.5.

But with mysql i have the same error! :-(

The only thing that change the situation is my being logged-in or not.

UPDATE: i have see some glitch... for example. I'm, simbus82, a joomla superadmin, admin is a superuser and it is the vendor.

I we log-in in FE we cannot enter in the category. If i in backend, i go to the vm users list, select my username and click "not a vendor"... in the FE i update the page and now i see the category!
But the vendor, admin, cannot enter in the category.

After, if i logout and then re-log-in, this time i can not enter in the category.

It is a VM related bug at this time... about the vendor/user control...

Another case when all works, it is when logged in or not.... the joomla SEF (and .htaccess) is disabled.

Joomla! 2.5.16 & VM 2.0.24b

PRO


simbus82

Quote from: BanquetTables.pro on April 07, 2012, 14:36:37 PM
have you tried the "install or update tables" in vmart?

No... it is secure to do in a production site?

UPDATE: i have do it! same problem!


UPDATE 2: it is so... strange... in a category i cant enter. But i can enter in SOME sub categories... i cant tell why.. if some are different than others... :S
Joomla! 2.5.16 & VM 2.0.24b

Milbo

First: This is a joomla error. The table with the problem is not a virtuemart table.

Second: Mysqli is not the best choice, it is often explained already in the forum. When you have a new mysql, higher than 5.3 or so, then you should use mysql, because it is the former mysqli. Is strange, but it is so.

Third: Due security reasons you must update now anyway to 2.0.4 which we are going to release asap. Use akeeba backup and install it locally, test the latest release safely at home!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

simbus82

Quote from: Milbo on April 07, 2012, 15:31:07 PM
First: This is a joomla error. The table with the problem is not a virtuemart table.

Second: Mysqli is not the best choice, it is often explained already in the forum. When you have a new mysql, higher than 5.3 or so, then you should use mysql, because it is the former mysqli. Is strange, but it is so.

Third: Due security reasons you must update now anyway to 2.0.4 which we are going to release asap. Use akeeba backup and install it locally, test the latest release safely at home!

yes, i have check the table... if a joomla what can cause it? i have do the category rebuild too in joomla admin.

But i see a new thing now!!!! O_o

I have enabled joomla caching under your advice Milbo (because my hosting limit the hourly queries, now the limit is 5000 for hour... it is lowwwww!) and it helped me to not overload the server.

For test i have disabled caching... now entering in VM categories is possible all the time if i logged-in too!

Ok, i try 2.0.4... i hope it can resolve this problem!
Joomla! 2.5.16 & VM 2.0.24b

simbus82

Updating to 2.0.4 not resolve this problem.

So:


- IF Joomla cache is enabled
AND
- IF i'm logged in

OR

-Joomla! System Debug in enabled


THEN i can't enter in a VM category to see the product list.


Joomla! 2.5.16 & VM 2.0.24b