Here is the code itself

if($status[0]['status'] == 'close'){ $access = "SELECT * FROM accesses WHERE id_login=$id_login AND access='teacher'"; $access = mysqli_query($db, $access);// == true? true : false; $access = mysqli_num_rows($access) == 1? true : false; if($access && !$death) return true; else return false; } else return true; } 

When you go to the site, this is the error

Notice: Undefined offset: 0

  • Well, there is also a string must be specified. - Ruslan Semenov
  • Well, with "0" only $ status. So in $ status there is no element [0] - Dmitry Kozlov

1 answer 1

Well, with 0 only $status . So in $status there is no element [0] . Try print_r($status);die; on the first line and see your array with its elements, and then you will deal with the array. And if you fail, write to the chat to figure it out.