php连接数据库报错!

#前面一直报错,显示调用未定义函数mysql_select_db()

img

img

18行代码mysqli_select_db参数搞反了,第一个是链接对象,第二个参数才是数据库
mysqli_select_db(mysqli $link, string $dbname): bool


42行代码mysqli_query缺少链接对象参数
mysqli_query(mysqli $link, string $query, int $resultmode = MYSQLI_STORE_RESULT): mixed
PHP: mysqli::query - Manual https://www.php.net/manual/zh/mysqli.query.php

42行mysqli_error也是缺少链接对象参数。
mysql_error(resource $link_identifier = ?): string
PHP: mysql_error - Manual https://www.php.net/manual/zh/function.mysql-error.php

题主最好先看下api。。参数都没搞对

img