I've created a new MySQL database, with a new table in it, and an HTML form to add records - and then I copied code I've used before to insert the records (using DBI) and it doesn't work. No records are added. And I'm getting no error message about connection problems. And I've filled in every field in the test. Here's the relevant Perl code:
use DBI; $dbh = DBI->connect('dbi:mysql:***:db371055412.db.1and1.com','***','** +*') or die("Cannot connect to database."); $sth = $dbh->prepare('insert into istanbul2011 (name, country, languag +e, union, title, email, cellphone, landlinephone, facebook, skype, tw +itter, gender, age, needshelp) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)') +; $sth->execute($name, $country, $language, $union, $title, $email, $cel +lphone, $landlinephone, $facebook, $skype, $twitter, $gender, $age, $ +needshelp); $dbh->disconnect();
Help!
Thanks.
In reply to DBI Insert not working by ericlee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |