Have a look at the line from the error message:
bool mysqli_select_db( mysqli $link, string $db_name);
That is not a valid PHP statement. It looks like you have copied the
PHP: mysqli::select_db - Manual[
^] function definition.
To use such functions, remove the types and replace the arguments with existing variables:
$select_db_result = mysqli_select_db($link, $db_name);
But there is even no need to call
mysqli_select_db()
because you can pass the database name also when connecting (as prominently noted in the above link):
$link = mysqli_connect($host, $uname, $pas, $db_name) or die ("cannot connect");
Note that I have correct the parameters to
mysqli_connect()
here too because the passed variables contain already the required data and creating a duplicate string is not necessary (the string created with "$host" is effectively the same as
$host
here).