[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-win32
Subject:    FW: Cannot insert/update columns with data that contains both single and double quotes from Windows
From:       "craig salee" <craig () rocksaltlabs ! com>
Date:       2003-02-28 16:31:32
[Download RAW message or body]

put double quotes around the value being submitted and then \ in front
of any ' or " within
the value.

So in the code, your sql string should look like this:

"Update table set
column="<>href=\"javascript:launchwindow14(\'http://www.domainname.com/d
cconnecters.ht 
m\')\">See Connectors""



From: "Keith Roberts" 
To: 
Subject: Cannot insert/update columns with data that contains both
single and double quotes from Windows via ADO 
Date: Fri, 28 Feb 2003 07:42:54 -0800 
I have a MySQL database. I am reading in a value from a database on the 
server that contains html code. I am trying to insert/update the values 
into a MySQL database on the internet. For example, I need to import a 
hyperlink that references a JavaScript window. The html looks like: 
UPDATE table SET column='value' 
<>href="javascript:launchwindow14('http://www.domainname.com/dcconnecter
s.htm' 
)">See Connectors 
As you can see, there is are two double quotes and two single quotes. If
I 
construct the value to be bracketed with single quotes and change the
all 
the quotes to doubles ('',""), then the query will work. However, it
will 
not write one of the doubles quotes to the database. If I bracket the
value 
with single quotes, then the doubled double quotes will not pass into 
the database, i.e.: 
'<>href=""javascript:launchwindow14(''http://www.domainname.com/dcconnec
ters.ht 
m'')"">See Connectors' will result in a database value of: 
<>href=""javascript:launchwindow14('http://www.domainname.com/dcconnecte
rs.htm 
')"">See Connectors 
If I change it and construct is as: 
"<>href=""javascript:launchwindow14(''http://www.domainname.com/dcconnec
ters.ht 
m'')"">See Connectors", it results in: 
<>href="javascript:launchwindow14(''http://www.domainname.com/dcconnecte
rs.htm 
'')">See Connectors 
If I use phpMyAdmin or MySQL CC on Windows 2000, the following value
will 
work properly: 
'<>href=\"javascript:launchwindow14(\'http://www.domainname.com/dcconnec
ters.ht 
m\')\">See Connectors' 
From Windows VB/Automate, I get the following error: 
ADODB.Parameters:Parameter object is improperly defined. Inconsistent or

incomplete information was provided. 
Connection String looks like: 
Provider=MSDASQL.1;Persist Security Info=False;Data Source=DSName 
I really think that this can be accomplished. The question is, how? 
-- 
Keith Roberts 
IT Manager - Laptops For Less 
2995 White Star 
Anaheim, CA 92806 
http://www.laptopsforless.com 
714.224.3980 
--------------------------------------------------------------------- 
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"
before 
posting. To request this thread, e-mail
win32-thread10645@lists.mysql.com 
To unsubscribe, send a message to the address shown in the 
List-Unsubscribe header of this message. If you cannot see it, 
e-mail win32-unsubscribe@lists.mysql.com instead. 



Add photos to your messages with MSN 8. Get 2 months FREE*.



---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail win32-thread10646@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail win32-unsubscribe@lists.mysql.com instead.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic