Create a Connection to a MySQLDatabase
From NIOS
Previous Page | Home Page | Next Page |
---|
ICT Applications
To start we must create a connection to the database. In PHP, this is done with the mysql_connect() function.
Syntax
mysql_connect(servername,username,password);
Example
<?php $con =mysql_connect("localhost","userid","abc123"); if (!$con) { die('Could not connect: ' .mysql_error()); } ?>
|
Previous Page | Home Page | Next Page |
---|
ICT Applications