establish connection between php and mysql in php

It is for static page, dynamic page, website, SEO, performance and other web development discussion
Joshi jahanvi

establish connection between php and mysql in php

Postby Joshi jahanvi » Tue Sep 16, 2014 5:58 pm

Write steps to establish connection from PHP to MySQL with sample code.


Guest

Re: establish connection between php and mysql in php

Postby Guest » Sun Sep 28, 2014 5:14 pm

Step – Connecting to a MySQL database

Code: Select all

<?php
$db = mysql_connect("localhost","username","password");
if (!$db) {
die("Database connection failed miserably: " . mysql_error());
}
?>


Return to “PHP, HTML, MYSQL and Web Hosting”

Who is online

Users browsing this forum: No registered users and 1 guest