I'm using embedded MySql statements in Perl to create a table and insert the first record. My code is:
$sth = $dbh->prepare ("
CREATE TABLE TEST (
`product` varchar(16) NOT NULL default '',
`title` varchar(40) NOT NULL default 'No Title',
`desc` longtext NOT NULL,
`image` varchar(24) NOT NULL default 'no-image.gif',
`price` decimal(10,2) NOT NULL default '0.00',
PRIMARY KEY (`product`)
)");
$sth->execute ();
$dbh->prepare ("INSERT INTO TEST VALUES ('a', 'b', 'c', 'd', 9999)");
$sth->execute ();
$sth->finish ();
$dbh->disconnect ();
When I go into phpMyAdmin The table is there but no record has been inserted. When I INSERT a record from phpMyAdmin it works fine. The program ends OK with the right displays.
Please help - this is holding me up.
$sth = $dbh->prepare ("
CREATE TABLE TEST (
`product` varchar(16) NOT NULL default '',
`title` varchar(40) NOT NULL default 'No Title',
`desc` longtext NOT NULL,
`image` varchar(24) NOT NULL default 'no-image.gif',
`price` decimal(10,2) NOT NULL default '0.00',
PRIMARY KEY (`product`)
)");
$sth->execute ();
$dbh->prepare ("INSERT INTO TEST VALUES ('a', 'b', 'c', 'd', 9999)");
$sth->execute ();
$sth->finish ();
$dbh->disconnect ();
When I go into phpMyAdmin The table is there but no record has been inserted. When I INSERT a record from phpMyAdmin it works fine. The program ends OK with the right displays.
Please help - this is holding me up.