in reply to Insert into MSSQL
I'm guessing you haven't checked your error log. (Update: or this isn't actually very close to the actual code you are using.)Global symbol "$FilmName" requires explicit package name at FILE line +LINE
I also notice here:
that you probably want to use "or" instead of "||". Since || has higher precedence than =, the way it is will assign the return value of do() to $sth, or assign 1 (the return value of print) if do() returned false. With or instead of ||, $sth will be left undefined if the do() fails.my $sth = $dbh->do( "INSERT INTO tblFilm (Name, Price) VALUES ('$FilmName', '$Price')") || + print "Can't prepare statement: $DBI::errstr";
|
|---|