Connection problem with conneciton class

I am having issues with connect
I see following errors:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/myfolder/public_html/myfolder/config.php on line 58

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/myfolder/public_html/myfolder/config.php on line 45

Please help.

here is my code:



<?php

	// site info
	define('HTTP_PATH', 'http://go/twi.tter.me/');
	define('URL_SHFT', 1);
	define('FS_PATH', dirname(__FILE__) . '/');
	
	// database info
	define('DB_PATH', 'localhost');
	define('DB_USER', 'login');
	define('DB_PASS', 'pass');
	define('DB_NAME', 'db');
	

  // database class
  
  class MySqlStuff {

	public $connection = null;
	public $database = null;

	public function __construct() {
	     
//		$this->connection = mysql_connect(DB_PATH, DB_USER, DB_PASS);
//		$this->database = mysql_select_db(DB_NAME);
		$this->connection = mysql_connect("localhost", "login", "pass");
		$this->database = mysql_select_db("mydb");

		return true;

	}

	public function Query($sql) {

		$result = mysql_query($sql);
		return $result;
	
	}

	public function FetchArray($sql) {

		$result = $this->Query($sql);
		$array = array();

		while($row = mysql_fetch_assoc($result)) {

			$array[] = $row;
			
		}

		return $array;
		
	}
	
	public function FetchSArray($sql) {

		$result = $this->Query($sql);
		$array = mysql_fetch_assoc($result);

		return $array;
		
	}
	
	public function InsertID() {
	
		return mysql_insert_id();
		
	}
	
	public function NumberRows($sql) {
	
		$result = $this->Query($sql);
		return mysql_num_rows($result);
		
	}

  }
  
  // connect to database
  $mysqlstuff = new MySqlStuff();
	
?>


Those errors indicate that the query has ended with an error.
For debug purposes, change


$result = mysql_query($sql);

into

$result = mysql_query($sql) or die("mysql error " . mysql_error() . " in query $sql");

That error is telling you that $result is not a valid resource {result set) which is what mysql_query() returns on success for select queries.

Possible causes include

1) you are not connected to the database when the query is run

2) there is a syntax or structure error in your sql query.