To run an application involving a database, create the database in command-line mode using MySQL. Click on Start > Run. Make sure the word command is in the box. Enter cd.. twice and then cd mysql, followed by cd bin. This will take you to the mysql\bin folder. Enter mysql. This starts MySQL. Assuming quiz is the name you want for your database, type:
create database quiz; quit;
Close the command prompt window. Click End Now.
In Notepad, write the following and save it as opendbq.php.
<?php global $DBname, $link; $host="localhost"; $user="root"; $password="12345"; $DBname="quiz"; $link=mysql_connect($host,$user,$password); mysql_select_db($DBname,$link); ?>
Use include or require as appropriate to include opendbq.php in all your files requiring access to this database.
Note: files can be in any descendant folder of wwwroot. For example, you can create a subfolder of phpstuff called quizphp and place all the quiz scripts in it. You would start the game by entering: