Takamoto has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks
This task should be trivial...but when I insert/update a record in my MySQL database with a value containing special characters, the special characters are not saved. No special message. Why?
#shortened script #getting pars with CGI my $q = CGI->new(); my $LicenseKey = $q->param('key'); my $UserName = $q->param('user'); my $UserPW = $q->param('pw'); my $dbhServer = DBI->connect("DBI:mysql:$db:$host", $user, $pass); my $sth = $dbhServer->prepare("INSERT INTO Accounts VALUES (?, ?, ?, ? +, ?)"); $sth->execute(undef, $LicenseKey, $UserName, $UserPW, $date) || print +("ERROR EXECUTION: " . $dbhServer->errstr); #same with updating my $sth = $dbhServer->prepare('update Accounts set UserName=?, Passwor +d=? WHERE LicenseKey=?'); $sth->execute($UserName, $UserPW, $LicenseKey)|| print ("ERROR EXECUTI +ON: " . $dbhServer->errstr); $dbhServer->disconnect;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI MySQL insert/update special characters
by Your Mother (Archbishop) on Mar 28, 2020 at 15:30 UTC | |
by Takamoto (Monk) on Mar 28, 2020 at 17:41 UTC | |
by jcb (Parson) on Mar 28, 2020 at 22:50 UTC | |
by haukex (Archbishop) on Mar 29, 2020 at 07:13 UTC | |
by jcb (Parson) on Mar 30, 2020 at 01:19 UTC | |
| |
by bliako (Monsignor) on Mar 29, 2020 at 12:13 UTC | |
by hippo (Bishop) on Mar 29, 2020 at 12:21 UTC | |
| |
by jcb (Parson) on Mar 30, 2020 at 01:26 UTC |
Back to
Seekers of Perl Wisdom