Oct 12, 2003, 9:04 AM
Post #1 of 3
I realise that this should go in the DBI forum, but i didn't think it was complex enough!
I'm sure this question is really simple- just not for beginners in MySQL!
I've having diffuculty using the DBI module.
I'm using many tutorials- but i can't get beyond the SELECT function.
I got the SELECT function to work and display whats in the database, but i can't get it to add.
This code below is my attempt- it's just the $SQL variable changed to my INSERT command.
Any help appreciated.
$dbh = DBI->connect("DBI:mysql:database=$DBNAME;host=$DBHOST;port=3306",$DBUSER,$DBPASS) or print $DBI::errstr;
$SQL = "
INSERT INTO `people`
('ID','First Name','Last Name','Age','Sex')
$cursor = $dbh->do($SQL);