r_mehmed has asked for the wisdom of the Perl Monks concerning the following question:
,at the same time i have the data inserted into the DB fine.I'm sure this isnt a bug just dont know how to get rid off!DBD::mysql::st execute failed: called with 1 bind variables when 0 are + needed at /cgi-bin/insert.pl line 44.
my $street = "http://www.streetmap.co.uk/streetmap.dll?postcode +2map?$zip&$zip"; #server vars and connection to the server + my $server = 'localhost'; my $db = 'somedb'; my $username= 'someusr'; my $password= 'somepass'; my $dbh =DBI->connect("dbi:mysql:$db:$server", $username, $password +,{RaiseError =>1}); #SQL statement my $SQL1 = "INSERT INTO property (address_1, address_2, county, cit +y, zip, description, status, bedroom, map) VALUES ('$address_1', '$ad +dress_2', '$county', '$city', '$zip', '$description', '$status','$bed +room',?)"; my $SQL2 = "INSERT INTO picture (property_id,url) VALUES ('property +_id'='pic_id','$file')"; #Prepare/execute and disconnect from db foreach my $sql ($SQL1,$SQL2) { my $sth = $dbh->prepare($sql) or die $dbh->errstr; $sth->execute($street) or die $dbh->errstr; } $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $sth->execute problem
by pfaut (Priest) on Jan 28, 2003 at 22:30 UTC | |
|
Re: $sth->execute problem
by scain (Curate) on Jan 28, 2003 at 22:26 UTC | |
|
Re: $sth->execute problem
by rdfield (Priest) on Jan 29, 2003 at 09:33 UTC | |
|
Re: $sth->execute problem
by OM_Zen (Scribe) on Jan 29, 2003 at 04:41 UTC |