I just edited your post to hide your password. Be careful!
First, like I said, I still wouldn't want to run a CREATE TABLE command through a CGI script. What happens when someone calls your program again? It will try to create a table that already exists. I've never tried to do that, so I can't guess what will happen. I suspect that things will die a horrible death, but no guarantees.
Second, you should either check all of your DBI calls for success, or add the RaiseError attribute to your connect call. See trs80's response below.
Last, you'll still want to have a unique, non-indentifying ID for the table.
CREATE TABLE players ( player_id INTEGER NOT NULL PRIMARY KEY, firstname VARCHAR (20) NOT NULL, lastname VARCHAR (20) NULL, ... more stuff here ... ) CREATE TABLE foo ( foo_id INTEGER NOT NULL PRIMARY KEY, player_id INTEGER NOT NULL REFERENCES players (player_id), stuff VARCHAR(30) NOT NULL )
Learning databases is a good thing, but be sure to learn them well. It's very easy to do thing wrong. Life is Hell for the programmer who is forced to work with a poorly designed database.
Update: I just tossed in the other table to show you how things things work. If your database will be simple enough that you only need one table, it's not necessary. If, however, it's going to be complex, you'll want to start learning these design issues.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to (Ovid) Re(3): dbi 500 error
by Ovid
in thread dbi 500 error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |