Displaying a random poem from a database
In addition to the depreciation and injection issues pointed out in the comments, I would just add that SELECT * FROM poems will fetch all columns for all rows, which is terribly inefficient. SELECT COUNT(*) FROM poems will return the number of records in the table, and you won't have to call mysql_num_rows.