اذهب إلى المحتوى

AliHussain

الأعضاء
  • المساهمات

    126
  • تاريخ الانضمام

  • تاريخ آخر زيارة

إجابات الأسئلة

  1. إجابة AliHussain سؤال في استفسارات عن بعض التفاصيل في PHP OOP كانت الإجابة المقبولة   
    لايعمل والسبب ان تعرف على البيانات بنوع StdClass 
    Fatal error: Uncaught Error: Call to undefined method stdClass::delete() ...  

     
    $data= $query->fetch(PDO::FETCH_CLASS, "Task"); وهذا لايعمل اذا كان fetch
     
     
     
    قمت بتجربة طريقة اخرى ونجح الامر
     
     
    class Task extends DBConnection { public $id; public $description; public $completed; public $table = self::class."s"; public static function find($id) { $pdo = parent::make(); $query = $pdo->prepare("SELECT * FROM tasks where id = $id"); $query->execute(); $data= $query->fetch(PDO::FETCH_OBJ); if($data) { $task =new Task; $task->id = $data->id; $task->description = $data->description; $task->completed = $data->completed; return $task; } else { return null; } } public function delete() { $pdo = parent::make(); $query = "delete from $this->table where id = $this->id"; $query = $pdo->prepare($query); $query->execute(); return "Record deleted successfully"; } }  
    Task::find(1)->delete();
  2. إجابة AliHussain سؤال في كيفية إصلاح مشكلة عدم عمل الخاصية borderStyle في React Native كانت الإجابة المقبولة   
    شكراً لكم جميعاً 
    سبب المشكلة لأنني قمت بوضع التنسيق على <Text> عندما قمت بوضعه على <View> اشتغل بنجاح
×
×
  • أضف...