Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Clean a database record off an apostrophe '

by vladb (Vicar)
on Jul 29, 2002 at 19:33 UTC ( [id://186058]=note: print w/replies, xml ) Need Help??


in reply to Clean a database record off an apostrophe '

Well, one straightforward approach to solving something like this would be to replace ' with " like I did here:
# Fetch row my ( $custno, $companyName, $address, $city, $state, $zip) = $SQL->fet +chrow_array(); print <<EndHTML; <script language="javascript"> fillCustomer("$custno", "$companyName", "$address", "$city", "$state", + "$zip"); </script> EndHTML
So, it wouldn't matter whether your address field has any ' in it.

_____________________
# Under Construction

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://186058]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-03-28 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found