I have been having a weird problem since noon today,

Code:
<?php
    class db {
	
		public $con = null;
		
		private $server = '127.0.0.1';
		private $user = 'root';
		private $pass = '';
		private $database = 'sites';

		public function __construct(){
			$this->con = new MySQLi($this->server, $this->user, $this->pass, $this->database);
				if ($this->con->connect_errno > 0){
					die('Error: Unable to connect to database ['.$this->con->connect_error.']');
				}
		}
		
		public function __distruct(){
			$this->con->close();
		}

		public function search($query){
			
			$query = $this->con->query($query);
			

			$result = array();
				while ($row = $query->fetch_assoc()){
					$result[] = $row;
				}
			return $result;
		}
	}
    
?>
I have been trying to call a query like this but returning 0 rows when i use a variable as the query.

Code:
SELECT * FROM `realtyimages` WHERE `rname` = 'pacific Monarch Resorts' AND `rcity` = 'Las Vegas' AND `rstate` = 'NV';
If i place that string into $this->con->query(SELECT * FROM `realtyimages` WHERE `rname` = 'pacific Monarch Resorts' AND `rcity` = 'Las Vegas' AND `rstate` = 'NV';"); it returns the rows.

However when i place that string into lets say $query, it returns 0 rows.

I had to write this a bit fast as work is almost over, but why am I having this problem? I cannot think of anything causing this to be a problem.

I will be rewriting this thread as soon as i get home. Thanks