php mysql_connect function

mysql_connect

php mysql_connect function

mysql_connect — Open a connection to a MySQL Server

This php function is used to connect to mysql database , mysql_connect function required three main parameters host name , database username and database password.

<?php

mysql_connect( ‘localhost’, ‘dbuser’, ‘dbpass’) or die(‘Could not connect to mysql server.’ );

?>

Returns a MySQL link identifier on success, or FALSE on failure.

php help is the biggest php resource

Advertisements

2 Comments »

  1. php mysql_close function « php help said

    […] $link = mysql_connect(’localhost’, ‘mysql_username’, ‘mysql_password’); // This line […]

  2. amitmondal said

    Nice tutorial….thanks for this post…..
    Please visit this link for learn more script.
    http://amitmondal.wordpress.com/

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: