I
Ivan Marsh
Hey Folks,
How do I go about escaping values entered into a form so they can be
dumped into a database?
For the record, I have no idea how the functions I'm using to write to the
database work because it's a proprietary product that I have to use, and
"they" don't release any documentation about how their internals work. I
just need to be able to prepare the string before it's passed to their
function.
For example, the classic last name = O'Maley... and I can't use escape(),
I need it to come out O\'Maley.
A single quote isn't the only thing I'm concerned with but it's a start,
and solves my immediate problem.
Is there an all powerful function that escapes all special
(non-alphanumeric) characters or do I need some fancy regex?
Any help is, as always, appreciated.
How do I go about escaping values entered into a form so they can be
dumped into a database?
For the record, I have no idea how the functions I'm using to write to the
database work because it's a proprietary product that I have to use, and
"they" don't release any documentation about how their internals work. I
just need to be able to prepare the string before it's passed to their
function.
For example, the classic last name = O'Maley... and I can't use escape(),
I need it to come out O\'Maley.
A single quote isn't the only thing I'm concerned with but it's a start,
and solves my immediate problem.
Is there an all powerful function that escapes all special
(non-alphanumeric) characters or do I need some fancy regex?
Any help is, as always, appreciated.