Write the statements which are used to connect PHP with MySQL?
Statements which can be used to connect PHP with MySQL is:
$conn = mysql_connect('localhost');
echo $conn;
?>
This statement gets the resource of localhost. There are other different ways with which you can connect to database and they are as follows:
mysql_connect('db.domain.com:33306','root','user');
mysql_connect('localhost:/tmp/mysql.sock');
mysql_connect('localhost','rasmus','foobar',
true,MYSQL_CLIENT_SSL|MYSQL_CLIENT_COMPRESS);
?>