PHP Classes

File: mysql_db_link.php

Recommend this page to a friend!
  Classes of Carter Comunale   mysql_db_link   ???   Download  
File: ???
Role: ???
Content type: text/plain
Description: Simple connection information class
Class: mysql_db_link
Author: By
Last change:
Date: 23 years ago
Size: 1,212 bytes
 

Contents

Class file image Download
<? class mysql_db_link { /* Class: db_link Function: This class is intended to maintain simple connection information for your mysql db. Author: Carter Comunale ([email protected]) Date: 02/06/2000 Modified Last By: <your name here> Modified Last Date: <your date here> example usage: mysql_query($sql, $my_link->link()) */ // Class Variables var $database_name; var $link; var $errorno; var $errmsg; // class constructor function mysql_db_link() { $host = "localhost"; $database = "your_db_name"; $user = "your_user_name"; $password = "your_password"; $this->database_name = $database; $this->link = mysql_pconnect ($host, $user, $password); mysql_select_db ($database, $this->link); $this->errno = mysql_errno($this->link); $this->errmsg = mysql_error($this->link); } // simple accessors function database_name() { return $this->database_name; } function link(){ return $this->link; } function errorno(){ return $this->errorno; } function errmsg() { return $this->errmsg; } } ?>