0

everything I do returns

warning: trying to access array offset on value of type null

when I print the $userinfo it returns my array but when I try to to grab a key it returns my error; and in 2nd returns f

    $userinfo = mysqli_fetch_assoc ($row);
    print_r($userinfo);
    echo $userinfo['Name'];
    print_r(isset($userinfo["Email"])?$userinfo["Email"] : "f");
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • It would be good to show all the variable definitions. Where do you connect to database? where $row is defined? etc. Also, mysqli_fetch_assoc can return NULL, so you need to check on that https://www.php.net/manual/en/mysqli-result.fetch-assoc.php – Bogdans Jan 20 '22 at 10:37
  • Please write what you want to do. What you do (use code-tags to mark your code). Also write, what you expect and what you get (including detailed error meesages. Also state, what tools (Programming Langugage, Operating System, whatever...) you are using. – kruemi Jan 20 '22 at 10:40

0 Answers0