I'm having a hard time understanding where is the problem...
I have a class which is responsible connecting to DB and passing queries.
(basically Data Access Layer)
and it looks like this:
class DB {
private $connection;
public function __construct(){
$this->connection = mysql_connect('localhost', 'user', 'pass');
mysql_select_db( 'dbname', $this->connection );
}
public function exec_query( $query ) {
mysql_query($query, $this->connection );
}
}
when I instantiate this class, everything is great... no errors
but when I call exec_query method, it prints the error:
supplied argument is not a valid MySQL-Link resource
and does not execute the query