Could someone help me make query using php oop, here is what I trying but not work:
$this -> hashs = DB::select('SELECT * FROM'. $this -> table .'WHERE'. $this-> colRep .'IS NULL &&'. $this -> colCol .'= ?', array($this -> commentHASH));
If I use normal variable work fine....
In php .
doesn't put a space between the elements you're concatenating. That'd be a start.
$this->hashs = DB::select('SELECT * FROM ' . $this->table . ' WHERE ' . $this->colRep . ' IS NULL AND ' . $this->colCol . ' = ?', array($this->commentHASH));
Try something like this. And if you are already using prepared statement, why only use it with the $this->commentHASH? You should never concatenate sql queries with php variables, as it is vulnerable to sql injections.