Forum Moderators: coopster & phranque
I am using a perl cgi to insert data in a mysql DB. It works good but if the data included '," or ; it doesnt insert ..
how would you validate the entries?
thanks a lot
Eg $mydata =~ s/,//ig;
Something like that - just do global replace for the characters you don't want with nothing, which is what I do on some validation for scripts.
$string=$dbh->quote("$string");
That should clear up problems relating to unescaped 'special' characters that might be confusing MySQL
$dbh->do('INSERT INTO orders SET item =?, price =?', undef, $item, $price);