Archive

Posts Tagged ‘Excel’

Database Connections in PHP

October 1st, 2009 Mehmatrix 1 comment


1.1) MYSQL Connection in PHP

We can use mysql_connect and mysql_select_db functions to create our connections. For closing the connections there is mysql_close function. These are basic functions of managing connections in PHP. There are also a lot of classes made by developers for free.

Sturcture 1.0:

1
2
3
4
5
<?php
$ConnectionName = mysql_connect('MyHost', 'MyLogin', 'MyPassword');
$DatabaseConnection = mysql_select_db('MyDatabaseName', $ConnectionName);
mysql_close($ConnectionName);
?>

You can determine the MyHost, MyLogin, MyPassword and MyDatabaseName variables as you need.

Example 1.0: We used hostname:port syntax Click to Read Complete Article »

Bookmark and Share
eXTReMe Tracker