Hi,

I'm trying to insert a record in a MySQL database using Perl. I already wrote a (working) Perl script to make queries, but now I get this problem.

This is the relevant part of the code:

$plaats = "Oostvoorne";
$straat = "Middellandweg";
$teller = 3;
$complex = 5;

$opdracht = "insert into woningen (complex,plaats,straat,huisnr) values ($complex,$plaats,$straat,$teller)";
$sth = $dbh->prepare($opdracht);
$sth->execute or die "Connection Error: $DBI::errstr\n";

This is the errormessage:

DBD::mysql::st execute failed: Unknown column 'Oostvoorne' in 'field list' at /home/Huub/workspace/VulWoningen/VulWoningen.pl line 31.
Connection Error: Unknown column 'Oostvoorne' in 'field list'

It says 'Unknown column'. That is right: It's no column, it's data to be inserted into the column. When I use the query directly in MySQL, there's no problem. So what is going wrong here?

Thanks for helping.

Huub


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to