Home > Blockchain >  i am getting this error although its working but its gives warning
i am getting this error although its working but its gives warning

Time:08-09

Warning: Trying to access array offset on value of type null in  

C:\xampp\htdocs\ecommerce_cms_tutorial\register.php on line 172 }elseif ($row_register['email'] != $email && $password == $confirm_password) {

CodePudding user response:

This happens because $row_register is not null but the index 'email' does not exist (yet). because you are using newer version of PHP You will need to add the following:

isset($row_register['email'])

CodePudding user response:

You are dealing with a null array element: You have 2 options:

  1. Use isset($arr['element'))

  2. Use @ with array like @$arr['element'];

    if(isset($row_register['email']){ // Enter your code here }

  •  Tags:  
  • php
  • Related