Virtual Open Schooling Online courses available at Virtual Open Schooling (VOS), for more details kindly click here!
NIOS Silver Jubilee Year
NIOS

Create a Connection to a MySQLDatabase

From NIOS
Jump to: navigation, search
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