Question

I write some big script, which have tajemniczy_users array. I need update data in this array. I have an object users and method updateUser()

public function updateUser() {
        $this->sth = $this->db->prepare("UPDATE tajemniczy_users SET username = :username, password = :password, uid = :uid, imie = :imie, nazwisko = :nazwisko, email = :email, pesel = :pesel, ulica = :ulica, kodpocztowy = :kodpocztowy, miejscowosc = :miejscowosc, wojewodztwo = :wojewodztwo, telefon1 = :telefon1, telefon2 = :telefon2, gg = :gg, skype = :skype, wyksztalcenie = :wyksztalcenie, zatrudnienie = :zatrudnienie, plec = :plec, stancywilny = :stancywilny, dzieci = :dzieci, internet = :internet, dostep = :dostep, fax = :fax, skaner = :skaner, aparat = :aparat, dyktafon = :dyktafon, miasta = :miasta, banki = :banki, d12_16 = :d12_16, d16_20 = :d16_20, d8_12 = :d8_12, brakd = :brakd, sklepy = :sklepy, hipermarkety = :hipermarkety, prowadzeniesamochodu = :prowadzeniesamochodu, wlasnysamochod = :wlasnysamochod, tajemniczy = :tajemniczy, uwagi = :uwagi WHERE id = :id;");
        $this->sth->bindValue(':username'               , $this->username               , PDO::PARAM_STR);
        $this->sth->bindValue(':password'               , $this->password               , PDO::PARAM_STR);
        $this->sth->bindValue(':uid'                    , md5(rand())                   , PDO::PARAM_STR);
        $this->sth->bindValue(':imie'                   , $this->imie                   , PDO::PARAM_STR);
        $this->sth->bindValue(':nazwisko'               , $this->nazwisko               , PDO::PARAM_STR);
        $this->sth->bindValue(':email'                  , $this->email                  , PDO::PARAM_STR);
        $this->sth->bindValue(':pesel'                  , $this->pesel                  , PDO::PARAM_STR);
        $this->sth->bindValue(':ulica'                  , $this->ulica                  , PDO::PARAM_STR);
        $this->sth->bindValue(':kodpocztowy'            , $this->kodpocztowy            , PDO::PARAM_STR);
        $this->sth->bindValue(':miejscowosc'            , $this->miejscowosc            , PDO::PARAM_STR);
        $this->sth->bindValue(':wojewodztwo'            , $this->wojewodztwo            , PDO::PARAM_STR);
        $this->sth->bindValue(':telefon1'               , $this->telefon1               , PDO::PARAM_STR);
        $this->sth->bindValue(':telefon2'               , $this->telefon2               , PDO::PARAM_STR);
        $this->sth->bindValue(':gg'                     , $this->gg                     , PDO::PARAM_STR);
        $this->sth->bindValue(':skype'                  , $this->skype                  , PDO::PARAM_STR);
        $this->sth->bindValue(':wyksztalcenie'          , $this->wyksztalcenie          , PDO::PARAM_STR);
        $this->sth->bindValue(':zatrudnienie'           , $this->zatrudnienie           , PDO::PARAM_STR);
        $this->sth->bindValue(':plec'                   , $this->plec                   , PDO::PARAM_STR);
        $this->sth->bindValue(':stancywilny'            , $this->stancywilny            , PDO::PARAM_STR);
        $this->sth->bindValue(':dzieci'                 , $this->dzieci                 , PDO::PARAM_INT);
        $this->sth->bindValue(':internet'               , $this->internet               , PDO::PARAM_INT);
        $this->sth->bindValue(':dostep'                 , $this->dostep                 , PDO::PARAM_STR);
        $this->sth->bindValue(':fax'                    , $this->fax                    , PDO::PARAM_INT);
        $this->sth->bindValue(':skaner'                 , $this->skaner                 , PDO::PARAM_INT);
        $this->sth->bindValue(':aparat'                 , $this->aparat                 , PDO::PARAM_INT);
        $this->sth->bindValue(':dyktafon'               , $this->dyktafon               , PDO::PARAM_INT);
        $this->sth->bindValue(':miasta'                 , $this->miasta                 , PDO::PARAM_STR);
        $this->sth->bindValue(':banki'                  , $this->banki                  , PDO::PARAM_STR);
        $this->sth->bindValue(':d12_16'                 , $this->d12_16                 , PDO::PARAM_INT);
        $this->sth->bindValue(':d16_20'                 , $this->d16_20                 , PDO::PARAM_INT);
        $this->sth->bindValue(':d8_12'                  , $this->d8_12                  , PDO::PARAM_INT);
        $this->sth->bindValue(':brakd'                  , $this->brakd                  , PDO::PARAM_STR);
        $this->sth->bindValue(':sklepy'                 , $this->sklepy                 , PDO::PARAM_STR);
        $this->sth->bindValue(':hipermarkety'           , $this->hipermarkety           , PDO::PARAM_STR);
        $this->sth->bindValue(':prowadzeniesamochodu'   , $this->prowadzeniesamochodu   , PDO::PARAM_STR);
        $this->sth->bindValue(':wlasnysamochod'         , $this->wlasnysamochod         , PDO::PARAM_INT);
        $this->sth->bindValue(':tajemniczy'             , $this->tajemniczy             , PDO::PARAM_STR);
        $this->sth->bindValue(':uwagi'                  , $this->uwagi                  , PDO::PARAM_STR);
        $this->sth->bindValue(':id'                     , $this->id                     , PDO::PARAM_INT);
        $this->sth->execute();
    }

Unfortunately this query doesn't update data. print_r($this->sth) after all bindValues return

PDOStatement Object ( [queryString] => UPDATE tajemniczy_users SET username = :username, password = :password, uid = :uid, imie = :imie, nazwisko = :nazwisko, email = :email, pesel = :pesel, ulica = :ulica, kodpocztowy = :kodpocztowy, miejscowosc = :miejscowosc, wojewodztwo = :wojewodztwo, telefon1 = :telefon1, telefon2 = :telefon2, gg = :gg, skype = :skype, wyksztalcenie = :wyksztalcenie, zatrudnienie = :zatrudnienie, plec = :plec, stancywilny = :stancywilny, dzieci = :dzieci, internet = :internet, dostep = :dostep, fax = :fax, skaner = :skaner, aparat = :aparat, dyktafon = :dyktafon, miasta = :miasta, banki = :banki, d12_16 = :d12_16, d16_20 = :d16_20, d8_12 = :d8_12, brakd = :brakd, sklepy = :sklepy, hipermarkety = :hipermarkety, prowadzeniesamochodu = :prowadzeniesamochodu, wlasnysamochod = :wlasnysamochod, tajemniczy = :tajemniczy, uwagi = :uwagi WHERE id = :id; ) 

I checked names, variables, types of data etc. I have no idea. Can you help me?

edit: bindValue return true or false, so I tried echo that values, but all of them are TRUE.

Table: http://pastebin.com/DQybkZE0

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top