in reply to dbi 500 error

The one followup explaining the need for the correct
header output using CGI is correct, but the code example
you posted has some errors as well.
#!/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();
First thing is the connect method in DBI it is lower case
you are using Connect which is not valid.
The DSN is incorrect see code below for correct syntax.
The use of a ' as a delimiter an SQL statement is
dangerous since ' is a common character in SQL. I prefer ~
in my code or !
There also seems to be a missing ( at the start of the
prepare statement.
The prepared statement is never executed. You need to call
$table->execute if you want it to take action.

I would rewrite this block as
#!/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();
Warning I did minimal testing on this code :^) and I
didn't get into table design like one of the other
responders did. Proper table design is very important and
beyond the scope of this reply.