一个文件调用另一个文件中的函数进行mysql的连接,
会提示报错Warning: Undefined variable $link in E:\webfile\template\docs\Connect.php on line 12
Fatal error: Uncaught TypeError: mysqli_query(): Argument #1 ($mysql) must be of type mysqli, null given in E:\webfile\template\docs\Connect.php:12 Stack trace: #0 E:\webfile\template\docs\Connect.php(12): mysqli_query(NULL, 'insert into use...') #1 E:\webfile\template\docs\Login.php(20): my_error('insert into use...') #2 {main} thrown in E:\webfile\template\docs\Connect.php on line 12
下面是代码
'; //echo mysqli_error(); exit; } return $res; } ?>