CAll Us: +91 88 00 563434   Login

Connecting to a MySQL Database on Linux Hosting Using PHP

By M K Mathur

There’s following a pattern code for connecting to a MySQL database utilizing PHP.

//Pattern Database Connection Syntax for PHP and MySQL.

//Join To Database
$yourfield = “your_field”;
$connection = mysql_connect($hostname, $username, $password);
mysql_select_db($dbname, $connection);

# Examine If Report Exists

$question = “SELECT * FROM $usertable”;

$outcome = mysql_query($question);

whereas($row = mysql_fetch_array($outcome))
$title = $row[“$yourfield”];
echo “Identify: “.$title.”

Related Posts