in reply to Issuing a DELETE statement with DBI
in some sense I just conclude the previous answers:
The perlish part
1. Don't use user inputs directly to modify a database
Use tainted variables, arrange the input intelligently.
The Database part:
2. It seems, that you use one large table for your project.
However, you should really do some normalization.
For example, create tables for the Artists, CDs, Titles separately. At least you should try to separate the static part of your database from the changing part, or slowly changing parts from fast changing parts. For example, create a table for the users (it is relatively static) and a table for the comments or deleted titles (relatively dynamic).
3. DELETE is on every serious RDBMS an operation that requires a COMMIT (sometimes this is done automatically) because it is an operation that can leave the database in an inconsistent state. May be, it is required here.
4. If DELETE is done frequently, use prepared statements.
These are some ideas for the moment. I hope these are useful for the further design.
|
|---|