Author Topic: DB Error: Bad SQL Query  (Read 4796 times)

0 Members and 1 Guest are viewing this topic.

Offline melanie

  • Newbie
  • *
  • Posts: 12
    • View Profile
DB Error: Bad SQL Query
« on: September 13, 2002, 12:57:37 AM »
Hallo Jan

Ich habe den Hoster gewechselt. Bin jetzt bei bluewin.ch. Die Installation lief problemlos. Als ich dann meinDomain/4images aufrufte sah ich die Gallerie in normaler Ansicht aber leider mit folgendem Fehler.

 :)
DB Error: Bad SQL Query: SELECT DISTINCT

i.image_id, i.cat_id, i.user_id,
i.image_name, i.image_description, i.image_keywords, i.image_date,
i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url,
i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes,
i.image_rating, i.image_hits, c.cat_name, u.user_name FROM 4images_images i,
4images_categories c
LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND c.cat_id = i.cat_id ORDER BY RAND()

You have an error in your SQL syntax near 'RAND()' at line 5


Kannst Du mir weiterhelfen?

Danke und Gruss: Mela

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
DB Error: Bad SQL Query
« Reply #1 on: September 13, 2002, 03:12:24 AM »
hi,

ich probiere es mal ;)
du hast eine niedrigere mysql version als benötigt.
abhilfe:
includes/constants.php
define('SHOW_RANDOM_CAT_IMAGE', 1);
auf 0 ändern..
dann klappts..
viel spass..
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline sintensity

  • Pre-Newbie
  • Posts: 6
    • View Profile
i have the same problem
« Reply #2 on: September 27, 2002, 03:27:48 AM »
can someone post that answer in english please.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
DB Error: Bad SQL Query
« Reply #3 on: September 27, 2002, 07:45:42 AM »
duscussed many times ;)
but here again:

if you get the error:
"You have an error in your SQL syntax near 'RAND()' at line XXXX"

you have a mysql version that is lower than required !

to avoid this problem, open constants.php and change

define('SHOW_RANDOM_CAT_IMAGE', 1);

to

define('SHOW_RANDOM_CAT_IMAGE', 0);
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi