[ php ] september 21 2011

PHP Code


$con = mysql_connect("localhost","db name","password");

Code Dissection
1. $con --- Variable. All variables in PHP start with a $symbol .
2. mysql_connect() --- A PHP function .
This function help to connect to the database and get access.

resource mysql_connect ([ string $server = ini_get("mysql.default_host") [, string $username = ini_get("mysql.default_user") [, string $password = ini_get("mysql.default_password") [, bool $new_link = false [, int $client_flags = 0 ]]]]] )
Opens or reuses a connection to a MySQL server.

source : http://php.net/manual/en/function.mysql-connect.php

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s