[8] ErrorException in Index.php line 75

Trying to access array offset on value of type null

  1. }
  2. public function info()
  3. {
  4. $id = input('id');
  5. $res = db('info')
  6. ->where('id', $id)
  7. ->field('id, tid, content, title, time, title, keywords, description')
  8. ->find();
  9. $data = db('info')->where('tid', $res['tid'])->limit(5)->select();
  10. $this->assign('id', $res);
  11. $this->assign('data', $data);
  12. $this->assign('info_id', 2);
  13. return view();
  14. }
  15. public function info1()
  16. {
  17. $id = input('id');

Call Stack

  1. in Index.php line 75
  2. at Error::appError() in Index.php line 75
  3. at Index->info()
  4. at ReflectionMethod->invokeArgs() in Container.php line 395
  5. at Container->invokeReflectMethod() in Module.php line 131
  6. at Module->think\route\dispatch\{closure}()
  7. at call_user_func_array() in Middleware.php line 185
  8. at Middleware->think\{closure}()
  9. at call_user_func() in Middleware.php line 130
  10. at Middleware->dispatch() in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 432
  13. at App->think\{closure}()
  14. at call_user_func_array() in Middleware.php line 185
  15. at Middleware->think\{closure}()
  16. at call_user_func() in Middleware.php line 130
  17. at Middleware->dispatch() in App.php line 435
  18. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER http://chinatuonai.com/info/65.html
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST chinatuonai.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME chinatuonai.com
SERVER_PORT 443
SERVER_ADDR 172.31.246.146
REMOTE_PORT 38706
REMOTE_ADDR 54.152.77.92
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/chinatuonai.com/public
DOCUMENT_URI /index.php
REQUEST_URI /info/65.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/info/65.html
SCRIPT_FILENAME /www/wwwroot/chinatuonai.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711639901.091
REQUEST_TIME 1711639901
Environment Variablesempty
ThinkPHP Constantsempty