İÇERİK GÜNCELLENDİ
Php veritabanı eklemede yardım
2
●63
- 11-09-2021, 19:45:14Merhaba
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:23emrhyzci adlı üyeden alıntı: mesajı görüntüle
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