PDA

View Full Version : how to deal with a ' in a string


doron
Fri 7th Jul '00, 3:25am
For the poll hack, I have this pretty big problem:

entering a ' in the question or options cause a mysql error, as it things the insert command in done, as ' are used to denote strings.

How is this handled in vB, can't seem to find the code for this.

thanks

Mas*Mind
Fri 7th Jul '00, 4:13am
You'll have to backslash it: \', this can easily be done with the php-function addslashes, eg:

$query = addslashes($query);

http://php.net/manual/function.addslashes.php

[Edited by Mas*Mind on 07-07-2000 at 04:14 AM]

doron
Fri 7th Jul '00, 6:36am
thanks! another bug bites the dust