Mario542
11-15-02, 15:04
| I'm am trying to get simple html page to work with a script using dbi and cgi. It works fine in mysql but when I change the dbname from DBI:mysql:test to DBI:ODBC:HERM which is a totally different database the html and script stop working. Has anyone seen this problem before, and if so could someone please help? Here is the perl code that I'm using. Thanks in advance.. Mario542 #!c:\perl\bin\perl.exe -wT # Get the input for POST method read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'}); #Split the name-value pairs ($name,$value)=split(/=/,$buffer); # Substitute special character to its original character $value=~ tr/+/ /; $value=~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; use DBI ; use CGI ; CGI::ReadParse (); $dbname="DBI:ODBC:HERM" $user=""; $passwd=""; $statement = "UPDATE staf SET name='superman' where name='$value'"; $dbh = DBI->connect(dbname, $user, $password) || die "$DBI::errstr"; $sth = $dbh->prepare($statement) ; $sth-> execute() ; |