insert .. values("OH"No")

insert .. values("OH"No")

am 30.10.2009 17:06:15 von Sydney Puente

--0-401246826-1256918775=:78728
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello, I am populating mysql with data, from an external source, that =
now and again in different fields has single quotes within the data intende=
d to be inserted into varchars.=0AThis causes a sql parse error.=0AIs there=
are smart way of dealing with this? TIA Syd =0A
--0-401246826-1256918775=:78728--

Re: insert .. values("OH"No")

am 30.10.2009 17:31:22 von Michael Dykman

Yes, there are plenty of smart ways to deal with this. Each of them
is somewhat dependant on whatever general purpose programming language
you are using and/or the environment you are working in.

In PHP we have mysql_escape_string() or PDO, in perl and Java, among
others, prepared statements are generally used. python appears to use
prepared statements under the covers.. it provides an similar
facility, at any rate.

What are you working in?

- michael dykman


On Fri, Oct 30, 2009 at 12:06 PM, Sydney Puente wrote:
> Hello,
>
> I am populating mysql with data, from an external source, that now and again in different fields has single quotes within the data intended to be inserted into varchars.
> This causes a sql parse error.
> Is there are smart way of dealing with this?
>
> TIA
>
> Syd
>
>
>



--
- michael dykman
- mdykman@gmail.com

"May you live every day of your life."
Jonathan Swift

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org