Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class db{
- var $username = 'metrots_testuser';
- var $password = '420smokeshit';
- var $host = 'localhost';
- var $database = 'metrots_phptest';
- var $cxn_result;
- //CREATE THE CONSTRUCTOR
- /*
- function __constructor(){
- }
- */
- //CREATE A FUNTION TO CONNECT TO THE DB
- function dbconnect(){
- $this->cxn_result = mysql_connect($this->host, $this->username, $this->password);
- if($this->cxn_result){
- echo "CONNECTION WAS SUCCESSFUL";
- } else {
- die('COULD NOT CONNECT'.mysql_error());
- }
- }
- //END OF CLASS
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement