How much PHP do you know? How much database design and SQL do you know? How much time are you willing to invest in this?
If the answer is "not much" for each of those, then I'd suggest googling for a ready-made script you can incorporate into your site. (I'm sure there must be dozens out there, maybe a few of them even halfway decent.)
If on the other hand you want to "roll your own", the the first thing to start with is the database design.