Sorry if it's noobish but i am just learning classes and i just can't get this fixed. Basicly i wrote a mysql class and now have hell of errors saying it does not let me connect to the database, is it me or am i doing something wrong. I use WAMP so i use root for username... no password, localhost and db name is correct as well. Here is the MySQL class.(part of it) [code]class mysql { //MySQL var var $mysql = array(); //MySQL settings. function settings(){ //MySQL settings. $this->mysql['host'] = $mysql['host']; $this->mysql['user'] = $mysql['user']; $this->mysql['pass'] = $mysql['pass']; $this->mysql['dbname'] = $mysql['dbname']; //MySQL errors. $this -> mysql['con_error'] = "<b>MySQL encountered a severe error while trying to connect to the host</b>n"; $this -> mysql['db_error'] = "<b>MySQL encountered a severe error while trying to use the database</b>n"; $this -> mysql['gen_error'] = "<b>MySQL Error: <b>Due to a database error this page cannot be displayed</b>n"; } //MySQL connect function. function do_connect(){ $this->settings(); $connect = mysql_connect($this->mysql['host'], $this->mysql['user'], $this->mysql['pass']); $db = mysql_select_db($this->mysql['dbname']); if(!$connect){ echo "<br>"; echo $this->mysql['con_error']; }elseif(!$db){ echo "<br>"; echo $this->mysql['db_error']; } } //MySQL query function function sql_run($sql){ $this->do_connect(); $res = mysql_query($sql); if(!$res){ echo "<br>"; echo $this->mysql['db_error']; }else{ return($res); } } //MySQL mysq_num_rows function. function num_rows($sql){ $this->do_connect(); $now = $this->sql_run($sql); $res = mysql_num_rows($now); if(!$res){ echo "<br>"; echo $this->mysql['db_error']; }else{ return $res; } }[/code] Please help, what am i doing wrong?