Esempio n. 1
0
            $this->db->resetErrors();
            $ret = false;
        } else {
            $this->db->endTransaction();
            $ret = $rows;
        }
        return $ret;
    }
    function updateRecord()
    {
        $sql = sprintf("update %s set " . "number = '%s'" . ", street = '%s'" . ", barangayID = '%s'" . ", district = '%s'" . ", municipalityCity = '%s'" . ", province = '%s'" . " where locationAddressID = %s", LOCATIONADDRESS_TABLE, fixQuotes($this->number), fixQuotes($this->street), fixQuotes($this->barangay), fixQuotes($this->district), fixQuotes($this->municipalityCity), fixQuotes($this->province), $this->locationAddressID);
        //echo $sql;
        $this->setDB();
        $this->db->beginTransaction();
        $this->db->query($sql);
        $locationAddressID = $this->db->insert_id();
        if ($this->db->Errno != 0) {
            $this->db->rollbackTransaction();
            $this->db->resetErrors();
            $ret = false;
        } else {
            $this->db->endTransaction();
            $ret = $this->locationAddressID;
        }
        return $ret;
    }
}
$locationAddress = new LocationAddress();
$locationAddress->selectRecordFromTdID(1);
echo $locationAddress->number;
echo "blablabla";