Basics of PHP - Part 4
Yesterday we looked at defining our variables in preparation for the database connection. Today we make the connection.
<?php
mysql_select_db($database, $mysqlconnection);
?>
The code broken down
<?php - Tell the server to expect and process php code
mysql_select_db($database, $mysqlconnection); - Use the 'mysql_select_db' function built within php to select a database. Within the () we pass the database name '$database' from a predefined variable and the connect details '$mysqlconnection' which was also defined in yesterdays code. We end with a ';' to tell the server we've finished with that particular part of code
?> - Close php tag, tell the server we're done with PHP
Tomorrow we're look at calling a row from the database and a full example of all the code working together
Cheers
Ryan Partington


