0

I am trying to run this MySQL query---

UPDATEsldruw_oldschoolapps2.jos_contentSETintrotext= replace(introtext, ’><img src="http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png" /></a>’, ' target="_blank" onclick="window.open('http://trkur.com/trk?o=11326&p=68773');"><img src="http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png" /></a>’);

and keep getting the following error---

#1064 - 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 '><img src="http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png" /></a>’, ' at line 1

I can't seem to find the reason for this syntax error. Please help!

2
Contributors
5
Replies
16
Views
3 Years
Discussion Span
Last Post by tony.grate
0

I replaced all " with ' and received this error---

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 84
STR: ><
SQL: UPDATE sldruw_oldschoolapps2.jos_content SET introtext = replace introtext, ’><img src='http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png' /></a>’, ' target='_blank' onclick='window.open('http://trkur.com/trk?o=11326&p=68773');UPDATE sldruw_oldschoolapps2.jos_content SET introtext = replace introtext, ’><img src='http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png' /></a>’, ' target='_blank' onclick='window.open('http://trkur.com/trk?o=11326&p=68773');UPDATE sldruw_oldschoolapps2.jos_content SET introtext = replace introtext, ’><img src='http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png' /></a>’, ' target='_blank' onclick='window.open('http://trkur.com/trk?o=11326&p=68773');

SQL query:

UPDATE sldruw_oldschoolapps2.jos_content SET introtext = replace introtext, ’><img src='http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png' /></a>’, ' target='_blank' onclick='window.open('http://trkur.com/trk?o=11326&p=68773');

MySQL said: Documentation

1064 - 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 'introtext, ’><img src='http://www.oldschoolapps.com/files/img/OSA_Rating-DL.pn' at line 1

0

That worked great! Thank you.

However, now I am running another query using that same syntax that just worked but with different content being replaced, and I am once again getting syntax errors---

UPDATE sldruw_oldschoolapps2.jos_content SET introtext = replace(introtext, ‘><img src="files/img/OSA_Rating-DL.png" alt="download abandonware games"/></a>', ' target="_blank" onclick="window.open(\'http://trkur.com/trk?o=11326&p=68773\');"><img src="http://www.oldschoolapps.com/files/img/OSA_Rating-DL.png" /></a>');
0

Nevermind that last error. I replaced the quote after "introtext, " and it worked. Thanks again!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.