When i want to store a mysql_query resource id into array i get this error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/localhost/htdocs/projekti/blog/libaries/Mysql.class.php on line 61 line 61: $this->query[$field] = mysql_query($query, $this->link) or die( "<b>MySQL error:</b> ".mysql_error()); But if i don't store a resource id into array, everything is ok. Why? No error: $this->query = mysql_query($query, $this->link) or die( "<b>MySQL error:</b> ".mysql_error());