roja...@gmail.com
unread,Dec 27, 2007, 4:13:41 PM12/27/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Connecticut PHP Developers Group - CPDG
This will save you time on coding a DB connection. This is to use on a
class.
--------------------------/
Connection /------------------------------------------------------
function db_connection($host,$user,$pass,$data){
$conn = @mysql_connect($host,$user,$pass);
if(!$conn){
$error = TRUE;
} else {
$error = FALSE;
mysql_select_db($data,$conn);
}//mysql end
return ($error);
$this->close = $conn;
}//Function db_connect close tag
-------------------------------------------------------------------------------------------------------
And here is the the close
---------------------------------/
Close /--------------------------------------------------------
function db_close(){
@mysql_close($this->close);
}//Function db_close close tag
-------------------------------------------------------------------------------------------------
NOTE: Only to use on a Class.