MySQL error

Hi everyone.
I have a last problem until my site is finishet. Its really nice to be at the finishing line after a lot of months of fixing problems.

I hpe someone can really help me with this last thing because im really stuck.

The problem is this:

I have 3 languages in my website, English, Swedish and German. On the site i have on the top of the page Categories, when you put the arrow on it then a list of Categories show up. In the English version you can click on one of the categories on the list and it takes you there, but on the swedish and german version i get this message:

A Mysql error has occurred while running the script:

The query you are trying to run is invalid
Mysql Error Output: 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 ') OR a.addl_category_id IN ())' at line 2
SQL Query: SELECT count(*) AS count_rows FROM shrimpau_auctions a LEFT JOIN shrimpau_users u ON u.user_id=a.owner_id WHERE a.active=1 AND a.approved=1 AND a.deleted=0 AND a.list_in!='store' AND a.catfeat='1' AND a.closed=0 AND (a.category_id IN () OR a.addl_category_id IN ())

I have tried hard to find it on google and other wbsites to fix it but no success, i hope someone nice and smart can help me with this last thing :slight_smile:

Please help

Best regards
Meduart

Well, that is a complicated query. Did you go thru it step by step and make sure that the database tables actually contains the data?

Also, sometimes when you are using multiple languages, when you create the drop-down for categories, the language itself could be causing an odd variable being passed to the query.

You should look at the page and VIEW-SOURCE on it and look at the drop-down section. See if it looks like the values you set in your program are correct. Sometime a dash, space or special character can creep in and cause the category drop-down to send the wrong value to the query.

Lastly, you can kill the query and use die($query); To display your query and see if it is worded correctly. There has to be something wrong in the query to get that error. But, since you are creating the query from data selected by a user, you need to look at the real value of the query and see what the problem is. Good luckā€¦

Sponsor our Newsletter | Privacy Policy | Terms of Service