Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DB{
- private $link_q="";
- var $suc="";
- var $connection_failed=false;
- var $db_failed=false;
- public function _construct(){}
- public function rp_connect($db_name="uid",$host="localhost",$user="root",$pass=""){
- $this->link_q=@mysql_connect($host,$user,$pass) or $this->ERROR_CONNECTION(true,'connection');
- $this->suc=@mysql_select_db($db_name,$this->link_q) or $this->ERROR_CONNECTION(true,'db');
- }
- public static function get_query($query_string){
- return @mysql_query($query_string);
- }
- public function link_result(){
- return $this->link_suc;
- }
- public function close_connection()
- {
- @mysql_close($this->link_q);
- }
- public function ERROR_CONNECTION($failure=false,$type="connection"){
- if($type=="connection"){
- $this->connection_failed=$failure;
- }
- else if($type=="db"){
- $this->db_failed=$failure;
- }
- }
- public function close(){
- @mysql_close($this->link_q);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement