in reply to dbi 500 error
First thing is the connect method in DBI it is lower case#!/usr/local/bin/perl use CGI; use DBI; my $dbh; $dbh = DBI->Connect("DBI:mysql:strossus:localhost","strossus", "********"); my $table = $dbh->prepare qq' CREATE TABLE players (realname CHAR(20), = gold CHAR(40))'); $dbh->disconnect();
Warning I did minimal testing on this code :^) and I#!/usr/local/bin/perl use strict; use CGI qw/:standard/; my $cgi = CGI->new(); print $cgi->header; use DBI; my $dbh; $dbh = DBI->connect('DBI:mysql:strossus@localhost', "strossus","********", { RaiseError => 1 }); my $table = $dbh->prepare(qq~ CREATE TABLE players ( realname CHAR(20), gold CHAR(40) )~ ); $table->execute(); $dbh->disconnect();
|
|---|