4images Help / Hilfe > Error Messages / Fehlermeldungen

DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...

(1/2) > >>

Jan:

--- Quote ---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
--- End quote ---
This means that you have a mysql version that lower than required!
RAND() requires MySQL version >= 3.23.23

Solution:

Open "includes/constants.php" and change

--- Code: ---define('SHOW_RANDOM_CAT_IMAGE', 1);
--- End code ---
to

--- Code: ---define('SHOW_RANDOM_CAT_IMAGE', 0);
--- End code ---

jaxeg:
DB Error: Bad SQL Query: SELECT 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 = 1 AND c.cat_id = i.cat_id ORDER BY image_name ASC LIMIT 0, 9
Unknown column 'i.user_id' in 'on clause'
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\programs\Apache2.2\htdocs\gall2\includes\db_mysql.php on line 116

apache 2.2
php 5.3.1
mysql 5.1.42-community

pleas help my

V@no:
Welcome to 4images forum.

Unknown column 'i.user_id' in 'on clause'

Arclight:
Hi,

After updating to version 1.7.9 i started to have problems with comments.

When uploading an image I sometimes get an error:
--- Code: ---DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 9314, word_id, 0, 0, 1 FROM 4images_wordlist WHERE word_text = 'Pionki'
Duplicate entry '9314-5129' for key 1
--- End code ---

Of course the word "Pionki" is an example, words differ. Sometimes i don't get any error at all, but some pictures uploaded after the update are not shown when i click on a keyword. It also happens when I add a keyword to a picture uploaded before the update.

Any ideas how to fix it?

Rembrandt:
Welcome in the Forum!

--- Quote from: Arclight on January 29, 2011, 08:08:51 PM ---...After updating to version 1.7.9 i started to have problems with comments.....
--- End quote ---

fix:
http://www.4homepages.de/forum/index.php?topic=28860.msg154915#msg154915

mfg Andi

Navigation

[0] Message Index

[#] Next page

Go to full version