Using PHP and MySQL to create dynamic, database-driven websites is a breeze. Just remember that the PHP functions are essentially a gateway to the database server; anything you'd enter using the MySQL command-line interface, you can use with the mysqli_query() function.
To connect to MySQL with PHP, you need to know your MySQL username, password, and database name. Once connected, you can issue standard SQL commands with the mysqli_query() function. If you have issued a SELECT command, you can use mysqli_num_rows() to count the records returned in the resultset. If you want to display the data found, you can use mysqli_fetch_array() to get all the results during a loop and display them onscreen.