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