4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2018, 08:55:34 AM

Login with username, password and session length
Search:     Advanced search
Check the new Tutorial subforum with helpfull guides and tutorials for modifications and tweaks.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Issues / Ausgaben
| |-+  Discussion & Troubleshooting (Moderators: Acidgod, ivan, Rembrandt)
| | |-+  apostrophe problem
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: apostrophe problem  (Read 20920 times)
clubbu
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 14
-Receive: 0


View Profile
« on: August 12, 2011, 09:17:45 AM »

Hello,
I have a problem when I try to change or add an image or keyword in the description field where there is an apostrophe.

The error displayed is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
DB ErrorBad SQL QuerySELECT word_textword_id FROM 4images_wordlist WHERE word_text IN ('laquila''anno''sisma''capoluogo''dellabruzzo''anno''sisma''foto''del''centro''storico''recintato''chiuso''pubblico''l'aquila', 'abruzzo', 'sisma', 'centro', 'storico', 'centro storico', 'recintato', 'chiuso', 'ricostruzione')
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
aquila', 'abruzzo', 'sisma', 'centro', 'storico', 'centro storico', 'recintato',' at line 3

DB Error
Bad SQL QueryINSERT INTO 4images_wordmatch (image_idword_idname_matchdesc_matchkeys_matchSELECT DISTINCT 220word_id001 FROM 4images_wordlist WHERE word_text 'l'aquila'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
aquila'' at line 4

DB Error
Bad SQL QuerySELECT word_textword_id FROM 4images_wordlist WHERE word_text IN ('laquila''anno''sisma''capoluogo''dellabruzzo''anno''sisma''foto''del''centro''storico''recintato''chiuso''pubblico''l'aquila', 'abruzzo', 'sisma', 'centro', 'storico', 'centro storico', 'recintato', 'chiuso', 'ricostruzione')
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
aquila', 'abruzzo', 'sisma', 'centro', 'storico', 'centro storico', 'recintato',' at line 3

DB Error
Bad SQL QueryINSERT INTO 4images_wordmatch (image_idword_idname_matchdesc_matchkeys_matchSELECT DISTINCT 219word_id001 FROM 4images_wordlist WHERE word_text 'l'aquila'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
aquila'' at line 4

DB Error
Bad SQL QuerySELECT word_textword_id FROM 4images_wordlist WHERE word_text IN ('laquila''anno''sisma''capoluogo''dellabruzzo''anno''sisma''foto''del''centro''storico''recintato''chiuso''pubblico''l'aquila', 'abruzzo', 'sisma', 'centro', 'storico', 'centro storico', 'recintato', 'chiuso', 'ricostruzione')
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
aquila', 'abruzzo', 'sisma', 'centro', 'storico', 'centro storico', 'recintato',' at line 3

DB Error
Bad SQL QueryINSERT INTO 4images_wordmatch (image_idword_idname_matchdesc_matchkeys_matchSELECT DISTINCT 218word_id001 FROM 4images_wordlist WHERE word_text 'l'aquila'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
aquila'' at line 4


the problem is the word --> l'aquila

thanks
paolo
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900

Vienna


View Profile WWW
« Reply #1 on: August 12, 2011, 11:24:51 AM »


http://www.4homepages.de/forum/index.php?topic=29950.msg158671#msg158671
« Last Edit: August 12, 2011, 06:05:47 PM by Rembrandt » 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)
clubbu
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 14
-Receive: 0


View Profile
« Reply #2 on: August 12, 2011, 11:41:24 AM »

Hello Rem,
will not work?

 Sad
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4187

Thank You
-Given: 116
-Receive: 900

Vienna


View Profile WWW
« Reply #3 on: August 12, 2011, 11:47:45 AM »

try this:

search in includes/search_utils.php:
1
$allwords_sql .= ($allwords_sql != "") ? ", '".$word."'" "'".$word."'";
replace:
1
$allwords_sql .= ($allwords_sql != "") ? ", '".addslashes($word)."'" "'".addslashes($word)."'";
search:
1
WHERE word_text '$key'";
and replace:
1
WHERE word_text '".mysql_real_escape_string($key)."'";

mfg Andi
« Last Edit: August 12, 2011, 06:04:43 PM by Rembrandt » 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)
clubbu
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 14
-Receive: 0


View Profile
« Reply #4 on: August 12, 2011, 06:33:43 PM »

Thanks for your help Rem..

Work!!  Very Happy Very Happy

Logged
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.073 seconds with 20 queries.
Post your comments here