Ok, I have been playing around with MySQL as everyone has been telling me how great it is
I have had a few problems. I manged to connect and disconnect from the database ok, but as soon as I added the INSERT INTO code into it it comes up with errors. Is my formatting of the query buggered up?
The code I am using is;
eval
{
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
use DBI;
};Well, thats for any help anyone can give me; I'm really looking forward to using SQL
Andy
if ($@)
{
print "Content-type: text/html \n\n";
print "Unable to find a certain module: $@";
}
# Get the info we need.
$query = new CGI;
$database = "aceinst_test";
$dbh = DBI->connect("DBI:mysql:database=$database", 'aceinst_admin', 'password') || die "Couldn't open database!";
$dbh->insert into members
(username, password, email, fullname, expire) values ('admin', 'password', 'webmaster@ace-installer.com', 'Andrew Newby', '12') || die "Unable to insert info";
$dbh->disconnect;
print "Content-type: text/html \n\n";
print "Done";
webmaster@ace-installer.com
http://www.ace-installer.com
I have had a few problems. I manged to connect and disconnect from the database ok, but as soon as I added the INSERT INTO code into it it comes up with errors. Is my formatting of the query buggered up?
The code I am using is;
Code:
#!/usr/bin/perl eval
{
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
use DBI;
};
Andy
if ($@)
{
print "Content-type: text/html \n\n";
print "Unable to find a certain module: $@";
}
# Get the info we need.
$query = new CGI;
$database = "aceinst_test";
$dbh = DBI->connect("DBI:mysql:database=$database", 'aceinst_admin', 'password') || die "Couldn't open database!";
$dbh->insert into members
(username, password, email, fullname, expire) values ('admin', 'password', 'webmaster@ace-installer.com', 'Andrew Newby', '12') || die "Unable to insert info";
$dbh->disconnect;
print "Content-type: text/html \n\n";
print "Done";
webmaster@ace-installer.com
http://www.ace-installer.com