نمایش نتایج 1 تا 3 از 3

نام تاپیک: من در حال طراحی یک cms هستم و کد کلاس کاربران را نوشتم اما با ارور مواجه شده ام لطفا راهنمایی کنید

  1. #1

    من در حال طراحی یک cms هستم و کد کلاس کاربران را نوشتم اما با ارور مواجه شده ام لطفا راهنمایی کنید

    <?php


    class User{

    public $id; // key
    public $username;
    public $password;
    public $first_name;
    public $last_name;


    public static function find_all_users(){ // پیدا کردن تمام کاربران



    return self::find_this_query("select * from users"); // استفاده از متد دیگر در اینجا

    }

    public static function find_user_by_id($user_id){ // برای پیدا کردن کاربر بر مبنای ای دی

    $result_set=self::find_this_query("select * from users where id= $user_id"); // استفاده از متد دیگر در اینجا




    $found_user=mysqli_fetch_array($result_set);
    return $found_user;

    }

    public static function find_this_query($sql){
    global $database;
    $result_set=$database->queryi($sql);
    $the_object_array= array();
    while($row = mysqli_fetch_array($result_set)){
    $the_object_array[]=self::instantioan($row);

    }
    return $the_object_array;


    }

    public static function instantioan($the_record){

    $the_object=new self;

    foreach($the_record as $the_attribute -> $valuee){
    if($the_object->has_the_attribute($the_attribute)){
    $the_object->$the_attribute = $valuee;
    }
    }

    return $the_object;
    }
    private function has_the_attribute($the_attribute){
    $object_properties= get_object_vars($this);
    return array_key_exists($the_attribute,$object_properties );





    }


    }


    ?>


    Notice: Undefined variable: valuee in C:\xampp\htdocs\gallery\admin\includes\user.php on line 46

    Warning: Creating default object from empty value in C:\xampp\htdocs\gallery\admin\includes\user.php on line 46

    Warning: array_key_exists(): The first argument should be either a string or an integer in C:\xampp\htdocs\gallery\admin\includes\user.php on line 56

    Notice: Undefined variable: valuee in C:\xampp\htdocs\gallery\admin\includes\user.php on line 46

    Warning: array_key_exists(): The first argument should be either a string or an integer in C:\xampp\htdocs\gallery\admin\includes\user.php on line 56

    Notice: Undefined variable: valuee in C:\xampp\htdocs\gallery\admin\includes\user.php on line 46

  2. #2
    کاربر دائمی آواتار plague
    تاریخ عضویت
    آبان 1388
    محل زندگی
    اهواز
    پست
    2,360

    نقل قول: من در حال طراحی یک cms هستم و کد کلاس کاربران را نوشتم اما با ارور مواجه شده ام لطفا راهنما

    foreach($the_record as $the_attribute -> $valuee)

    باید بشه


    foreach($the_record as $the_attribute=>$valuee)

  3. #3

    نقل قول: من در حال طراحی یک cms هستم و کد کلاس کاربران را نوشتم اما با ارور مواجه شده ام لطفا راهنما

    نقل قول نوشته شده توسط plague مشاهده تاپیک
    foreach($the_record as $the_attribute -> $valuee)

    باید بشه


    foreach($the_record as $the_attribute=>$valuee)

    خدا خیرت بده درست شد

تاپیک های مشابه

  1. پاسخ: 1
    آخرین پست: دوشنبه 12 مرداد 1394, 12:25 عصر
  2. سوال: ترجمه دکمه های بستن بازیابی کوچک نمایی و بزرگ نمایی در یک پروژه ام اف سی
    نوشته شده توسط little.boy در بخش برنامه نویسی با MFC و ++Visual C
    پاسخ: 2
    آخرین پست: دوشنبه 01 اسفند 1390, 10:49 صبح
  3. سوال: استفاده ازusercontrol در وب سایت هایی که ازmasterpage استفاده شده.
    نوشته شده توسط zareei_ta در بخش ASP.NET Web Forms
    پاسخ: 4
    آخرین پست: پنج شنبه 27 خرداد 1389, 17:33 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •