• 11-09-2021, 19:31:21
    #1
    Merhaba veritabanına yeni bir alan oluşturdum kişilerin mail adreslerini yazdırmak için mail adreslerini inputun içine yazdırıyorum şu şekilde



    İÇERİK GÜNCELLENDİ
  • 11-09-2021, 19:45:14
    #2
    Merhaba

    class LicenseModel extends Model
    {
        protected $table = 'licenses';
        protected $primaryKey = 'id';
        protected $allowedFields = ['product', 'key', 'domain', 'type', 'until'];
        function get_valid_licenses_count() {
            return $this->db->table($this->table)->where('(until > '.time().') OR (until = 0)')->countAllResults();
        }
        function get_license_by_id($id) {
            $id = $this->db->table($this->table)->where("id", $id)->get()->getResultArray();
            return count($id) > 1 ? $id[1] : null;
        }
        function check_license($domain, $product) {
            return $this->db->table($this->table)->where('((domain = "'.trim($domain).'") AND (product = "'.$product.'")) AND ((until > '.time().') OR (until = 0))')->countAllResults()>0;
        }
        function check_license_by_key($domain, $key) {
            return $this->db->table($this->table)->where('((domain = "'.trim($domain).'") AND (key = "'.$key.'")) AND ((until > '.time().') OR (until = 0))')->countAllResults()>0;
        }
    }
    Bu şekilde denermisin.
  • 11-09-2021, 19:50:23
    #3
    emrhyzci adlı üyeden alıntı: mesajı görüntüle
    Merhaba

    class LicenseModel extends Model
    {
        protected $table = 'licenses';
        protected $primaryKey = 'id';
        protected $allowedFields = ['product', 'key', 'domain', 'type', 'until'];
        function get_valid_licenses_count() {
            return $this->db->table($this->table)->where('(until > '.time().') OR (until = 0)')->countAllResults();
        }
        function get_license_by_id($id) {
            $id = $this->db->table($this->table)->where("id", $id)->get()->getResultArray();
            return count($id) > 1 ? $id[1] : null;
        }
        function check_license($domain, $product) {
            return $this->db->table($this->table)->where('((domain = "'.trim($domain).'") AND (product = "'.$product.'")) AND ((until > '.time().') OR (until = 0))')->countAllResults()>0;
        }
        function check_license_by_key($domain, $key) {
            return $this->db->table($this->table)->where('((domain = "'.trim($domain).'") AND (key = "'.$key.'")) AND ((until > '.time().') OR (until = 0))')->countAllResults()>0;
        }
    }
    Bu şekilde denermisin.


    Yorum için teşekkür ederim hocam ama idlerde herhangi bir problem yok veritabanındakı olusturan yere kişinin mail adresini yazdırcam input olarak bunu yaptım sadece veritabanına yazdırırken olusturan bölüme kişini yazdıgı mail adres düşmüyor sadece burdaki kodlara ' olusturan ' adında bir ekleme olcak