4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 15, 2018, 01:14:20 PM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Help / Hilfe
| |-+  Error Messages / Fehlermeldungen
| | |-+  DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...  (Read 53590 times)
Jan
Administrator
4images Guru
*****
Offline Offline

Posts: 5024

Thank You
-Given: 0
-Receive: 31


View Profile WWW
« on: January 04, 2003, 08:52:13 AM »

Quote  [Expand]
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
1
define('SHOW_RANDOM_CAT_IMAGE', 1);
to
1
define('SHOW_RANDOM_CAT_IMAGE', 0);
« Last Edit: March 15, 2005, 01:49:11 AM by Chris » Logged

Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
jaxeg
Pre-Newbie

Offline Offline

Posts: 1

Thank You
-Given: 0
-Receive: 1


View Profile
« Reply #1 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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #2 on: January 17, 2010, 08:19:19 PM »

Welcome to 4images forum.

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

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Arclight
Pre-Newbie

Offline Offline

Posts: 5

Thank You
-Given: 1
-Receive: 0


View Profile
« Reply #3 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:
1
2
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?
Logged
Rembrandt
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 899

Vienna


View Profile WWW
« Reply #4 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
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Arclight
Pre-Newbie

Offline Offline

Posts: 5

Thank You
-Given: 1
-Receive: 0


View Profile
« Reply #5 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
Logged
Rembrandt
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 899

Vienna


View Profile WWW
« Reply #6 on: February 05, 2011, 01:31:13 PM »

http://www.4homepages.de/forum/index.php?topic=28413.15
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.058 seconds with 19 queries.
Post your comments here