pulling random from database list

wxdqz

New Member
I could use some advise, maybe some sample code. I am using PHP and mysql. I have a table of songs in my database. I need to setup this table so that it can pull a random row from the table and display its contents. I had implemented this with an auto_increment ID number as the primary key, but I ran into trouble when I would delete songs from the database, because it left gaps which screwed up my function I had for picking the random row.

Any advise on how I could implement this?
 
Back
Top