4images Forum & Community

4images Help / Hilfe => Error Messages / Fehlermeldungen => Topic started by: Jan on January 04, 2003, 08:52:13 AM

Title: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: Jan on January 04, 2003, 08:52:13 AM
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
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: [Select]
define('SHOW_RANDOM_CAT_IMAGE', 1);to
Code: [Select]
define('SHOW_RANDOM_CAT_IMAGE', 0);
Title: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: jaxeg on January 17, 2010, 03:22:20 PM
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
Title: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: V@no on January 17, 2010, 08:19:19 PM
Welcome to 4images forum.

Unknown column 'i.user_id' in 'on clause' (http://www.4homepages.de/forum/index.php?topic=22668.0)
Title: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: Arclight on January 29, 2011, 08:08:51 PM
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: [Select]
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

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?
Title: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: Rembrandt on January 29, 2011, 09:43:35 PM
Welcome in the Forum!
...After updating to version 1.7.9 i started to have problems with comments.....

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

mfg Andi
Title: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: Arclight on February 05, 2011, 12:55:00 PM
Hi!

Many thanks, but after applying the fix search engine still doesn't see two words like "SU45-156". It shows all pictures with a keyword "SU45" and not these with "SU45-156" only - when I (or someone else) enters the word "SU45-156" in the search box or by clicking on a keyword.

Any ideas how to fix it?

Thanks in advance.

Regards
Title: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
Post by: Rembrandt on February 05, 2011, 01:31:13 PM
...
Any ideas how to fix it.....
http://www.4homepages.de/forum/index.php?topic=28413.15