Let's asume I have following object in PHP:
class param{
public $home; //set by another function
public $user; //set by another function
public function createRequest(){
//in this function I want to create mysql string with $home and $user
$sql = "select * FROM table WHERE home =".$this->home." AND user=".$this->user;
return $sql;
}
Problem is, that $home (or $user) could be empty string and in this case I want to include all homes (or users), not just columns, where home="" (or user="");
Do you have any suggestion how to do that? Or is this idea wrong? (I'm just beginner with PHP)