codeigniter php严重性:通知消息:未定义索引:user_id

时间:2016-01-26 18:02:15

标签: codeigniter

array(3) { 
    [0]=> array(15) { 
        ["guest_list_id"]=> string(1) "0" 
        ["event_type_id"]=> string(1) "2" 
        ["event_id"]=> string(1) "1" 
        ["guest_attendance_status"]=> NULL 
        ["user_id"]=> string(1) "9" },

访问$user['user_id']时,出现错误:

  

遇到PHP错误   严重性:通知
  消息:未定义的索引:user_id

评论代码

if (!empty($user)) { 
   foreach ($user as $key => $value) { 
      $user_details = array(
         'user_id' => $user['0']['user_id'],
          'eventTitle' => $user['pre_wedding_event_title']
       ); 
    } 
 } 

0 个答案:

没有答案