Anything you create with PHP is essentially dynamic. In particular, on the request from the client side, you can make a query, obtain data from database and generate the whole page in PHP code. This is what PHP is generally used for, as well as other server-side technologies.
Instead of asking for code, just try to do it, after reading some documentation. Please see:
http://php.net/manual/en/refs.database.php[
^].
Be extra careful. Be aware of
SQL injection:
http://xkcd.com/327[
^].
Here is it explained in further detail:
http://en.wikipedia.org/wiki/SQL_injection[
^].
—SA