$variable = 'campo1,campo2';$variable2 = 'mitabla';$variable3 = 'id=id';$sql = "SELECT ". $variable ." FROM ". $variable2 . " WHERE ". $variable3;