Cytat(nospor @ 7.04.2016, 11:16:39 )

Uwielbiam takie odpowiedzi :/
Tak, jesli ja usuniesz, to ci dziala, bo masz ja zle napisana to logiczne ze dziala gdy ja wywalisz....
A co ja ci moge powiedziec wiecej po takiej ilosci kodu co tu nam dales? Jakas wyrwana z kontekstu funkcja, czort wie jak wyglada reszta kodu... Na chwile obecna $this->_db jest NULLem i tyle w temacie
No tak sorry, tutaj jest oto funkcja.Ostatnia na samym dole.
setMassagesToRead()
class Server
{
private $_db;
public function __construct(){
$this->_db = Connection::getInstance();
}
public function selectAbleSkills(){
$query = $this->_db->prepare("SELECT * FROM skill_type");
$query->execute();
return $query;
}
public function selectExistingStudy(){
$query = $this->_db->prepare("SELECT * FROM list_education");
$query->execute();
return $query;
}
public function addMatch($dataMijn, $dataJouw, $dataLike){
$query = $this->_db->prepare("INSERT INTO user_match (user_1,user_2,`match`) VALUES (:dmi,:djo,:dli)");
$query->bindParam(":dmi",$dataMijn, PDO::PARAM_INT);
$query->bindParam(":djo",$dataJouw, PDO::PARAM_INT);
$query->bindParam(":dli",$dataLike, PDO::PARAM_INT);
$query->execute();
return $query;
}
/*public function checkIfOtherUserAlreadyMatched($secondUserID,$userID){
$query = $this->_db->prepare("SELECT * FROM user_match WHERE user_1=122 AND user_2=126 AND `match`=1");
$query->bindParam(":suid",$secondUserID,PDO::PARAM_STR);
$query->bindParam(":uid",$userID,PDO::PARAM_STR);
$query->execute();
return $query;
}*/
public function loadUserDataForApp($tokenPushID){
$query = $this->_db->prepare("SELECT A.id, A.nameSurname, A.img_id, A.login_type, A.user_type FROM data_user A WHERE A.token_push_id = :token");
$query->bindParam(":token", $tokenPushID, PDO::PARAM_STR);
$query->execute();
return $query;
}
public function getChatID($u1,$u2){
$query = $this->_db->prepare("SELECT id FROM chatbox WHERE user_1=:u1 AND user_2=:u2 OR user_1=:u2 AND user_2=:u1");
$query->bindParam(":u1",$u1,PDO::PARAM_STR);
$query->bindParam(":u2",$u2,PDO::PARAM_STR);
$query->execute();
return $query;
}
public function setMassagesToRead($userID,$boxID){
$query = $this->_db->prepare("UPDATE chat SET seen = 1 WHERE user_sender =:id AND chatbox_id =:boxID");
$query->bindParam(":id",$userID,PDO::PARAM_STR);
$query->bindParam(":boxID",$boxID,PDO::PARAM_STR);
$query->execute();
return $query;
}
public static function getInstance
()
{
if(self::$instance === null)
{
self::$instance = new self();
}
return self::$instance;
}
}