Author Topic: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...  (Read 16111 times)

0 Members and 1 Guest are viewing this topic.

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« on: January 05, 2012, 11:28:06 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
Hi,
habe gleiche problem aber beim hochladen fotos, hilt mir es?
Version 1.7.10

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #1 on: January 08, 2012, 03:52:24 AM »
Alle sind tot.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #2 on: January 08, 2012, 03:30:10 PM »
Are you using unmodified 1.7.10 or it's an upgrade?
Did you try the fix above?
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)

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #3 on: January 08, 2012, 10:09:01 PM »
Are you using unmodified 1.7.10 or it's an upgrade?
Did you try the fix above?
I have a new 1.7.10, installed a new
But I have this error comes when you add images

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #4 on: January 10, 2012, 08:09:30 PM »
Again silence ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #5 on: January 10, 2012, 09:12:43 PM »
I just uploaded an image to your site and it didn't give me any errors.
Perhaps you should start by telling exactly what you do and how to reproduce?
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)

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #6 on: January 10, 2012, 09:44:26 PM »
I just uploaded an image to your site and it didn't give me any errors.
Perhaps you should start by telling exactly what you do and how to reproduce?
It gives an error when adding to the database, not at all the pictures, through the admin panel

Почему-то мне он снова выдал ошибку.
« Last Edit: January 10, 2012, 09:58:37 PM by ASAD »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #7 on: January 10, 2012, 10:46:47 PM »
I've split your post into independent topic, it's not related to the topic you replied originally.

I can't reproduce it on my test site, it must be some kind of missconfiguration on your site, like different encoding used on page and database

I would need access to your site as admin to run some tests for further assistance.

For now try go through these topics, maybe you'll find a solution:
Search Results
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)

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #8 on: January 11, 2012, 08:53:31 AM »
I've split your post into independent topic, it's not related to the topic you replied originally.

I can't reproduce it on my test site, it must be some kind of missconfiguration on your site, like different encoding used on page and database

I would need access to your site as admin to run some tests for further assistance.

For now try go through these topics, maybe you'll find a solution:
Search Results

tnx,
I'll wait for your result

I think that because of this:

Well according to your third screenshot all tables are using cp1251 encoding, but 4im_wordmatch uses latin and that's the table produces error.
First thing I'd suggest you do is backup your database via phpmyadmin.
Then open 4im_wordmatch table, then click on "operations" ("операции") and change collation to cp1251. Hopefully it won't break existing keywords, if it did, simply run "recreate keywords" plugin in ACP.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #9 on: January 11, 2012, 01:19:42 PM »
I still can't reproduce it...can you tell exactly what fields to fill up and with what (what text). And if you say it's not with every image, then I'll need an image that causing it too.
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)

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #10 on: January 11, 2012, 09:54:29 PM »
ok, I say

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #11 on: January 13, 2012, 10:18:05 PM »
hab hier geandert encoding auf  cp1251 - ALTERTABLE`4images_wordmatch`
gibt es kein Fehler, mal sehen was passiert.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #12 on: January 18, 2012, 10:03:55 PM »
Ok, on your website when image information (name, description, keywords) has a word that present more then once, and one of these words has a capital letter, it produces this error.
For example a name "Проба проба" will cause the error.

I believe it has something to do with MySQL configuration rather then PHP/Apache/4images

Unfortunately I still can't reproduce this error on my local server.
Try execute this mysql query in phpmyadmin:
Code: [Select]
INSERT INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 636, word_id, 1, 0, 0 FROM 4images_wordlist WHERE word_text = 'ïðîáà'will it give you error?
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)

Offline ASAD

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Fotos von Grozny
Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #13 on: January 28, 2012, 08:15:27 PM »
Sorry, that did not respond for a long time.
 Yes, it gives an error.

On the internet read this but, it turns off completely site.

Quote
Очень часто встречаются ошибки в виде крокозябр, вопросиков и непонятных символов на сайтах, вместо нормально текста.
это можно поправить через .htaccess

Отображение не нужной кодировки связанно с тем что, на сервере по умолчанию допустим стоит универсальная кодировка utf-8, а на сайте используется windows-1251.

Наша цель заставить обрабатывать сервер указанные сайты в нужной нам кодировке, для этого пишем в файле .htaccess

DefaultLanguage ru
AddDefaultCharset windows-1251
php_value default_charset "cp1251"

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Re: DB Error: Bad SQL Query: SELECT DISTINCT i.image_id ...
« Reply #14 on: January 28, 2012, 09:05:57 PM »
DefaultLanguage ru
AddDefaultCharset windows-1251
php_value default_charset "cp1251"
That didn't work?
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)