It is several pages which are fairly long as I include files but I will post as much as I can :) thanks for helping. I hope this enough, I think Ive provided everything? index.php [code] //require the drivers for connection to mysql require('lib/driver.inc.php'); //start session before anything else session_start(); //create a new object for page class $connect = new CDriver(); //open connection to database and leave open for all queries to use $connect -> Connect(); //requires authorize to check if a user has tried to login, it creates a session for them require_once('lib/user_func.inc.php'); $user_func = new user_func(); $user_func->check_login(); [/code] section of user_func.php, function for checking login [code] //create a query $sql = "SELECT * FROM users"; $connect->Query($sql); [/code] driver.inc.php [code] class CDriver { var $db_conn; var $db_config; var $db_list; var $table_list; function Connect() { $this->db_conn = mysql_connect('localhost', '*', '*') or die(mysql_error()); mysql_select_db( havoc_site, $this->db_conn ) or die(mysql_error()); } //function to execute mysql query function Query($query) { $result = mysql_query($query, $this->db_conn); if($err = mysql_error($this->db_conn)) { echo "Error on query: ". $query . "<br>" . $err ; } else { return $result; } } [/code]