PHP Classes

File: data/dbcon.php

Recommend this page to a friend!
  Classes of Lee J   PHP easy ticket and help system   data/dbcon.php   Download  
File: data/dbcon.php
Role: Auxiliary data
Content type: text/plain
Description: data base connection file
Class: PHP easy ticket and help system
Manage help desk ticket submissions
Author: By
Last change:
Date: 13 years ago
Size: 1,690 bytes


Class file image Download
<?php /* Name: dbcon.php Description: database addon for pets ( php easy ticket system ) Purpose: to connect and disconnect the sql db Maker: lee johnstone Site: Support: -------------------------------------------------------------------------------------------------------------------------- YOU MAY NOT 1. Use this for commercial usage 2. Claim the code as your own 3. Remove any copyrights from its original authors YOU MAY 1. Upgrade, Update, Adjust, Modify this script, providing you keep all original comments. 2. Redistribute this code under the same license and none other. 3. Modify and use this script on your own site as you wish, providing you keep the copyright markings from original authors. More information here. -------------------------------------------------------------------------------------------------------------------------- */ function checkdb(){ if(!isset($g_link)){ $g_link = false; } } function OpenDb(){ if($g_link) return $g_link; $db_host = "YOURHOST"; //MySQL hostname (default is localhost) $db_user = "YOUR_USER_NAME"; // MySQL Data Base user name (default is root) $db_password = "YOUR_PASSWORD";// MySQL Data Base Password $db_name = "phpticket"; // MySQL Data Base Name (default is phpticket) $g_link = mysql_connect($db_host, $db_user, $db_password) or die('Could not connect to mysql server.' ); mysql_select_db($db_name) or die('Could not select database.'); return $g_link; } function CloseDb(){ if($g_link!=false) mysql_close($g_link); $g_link = false; } ?>