mysqli_query至少需要2个参数

This mysqli_query command results in the error below

mysqli_query("INSERT INTO `counter`.`hits` (`page_hits`) VALUES ('".$hits."')"); 

"Warning: mysqli_query() expects at least 2 parameters, 1 given in"

What does this error message mean, and how can it be fixed?

From the manual

Procedural style

mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )

You'll notice the $link and $query variables.

This means that you need to pass the function a valid mysqli link resource as well as the query you wish to perform. This lets the function know which established connection to the server to use.

A link resource can be created using:

Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init()

and an example of how to do so can be found on the aforementioned manual page.

It seems you are confusing mysql_query with mysqli_query. The former accepts the sql statement as the first param, while the latter expects a link identifier (created by Mysqli::connect) as the first param and the statement as the second.

The two extensions are not compatable with each other. I suggest you pick one, read the manual pages on how to connect, execute queries, etc, and forget the other exists. which one you pick is up to you, mysqli is more feature rich but more complicated as a result.

you need to specify the connection that you made to your database somewhere earlier in your page. you should put that variable in the query. Suppose you made a variable called $con. Then your code should be like this.

mysqli_query($con,"INSERT INTO `counter`.`hits` (`page_hits`) VALUES ('".$hits."')"); 
<?php
include_once('insert.php');
if(isset($_POST['submit']))
{
     $name = $_POST['name'];
     $email = $_POST['email'];
     $address = $_POST['address'];
     $adm= $_POST['admission'];
    mysqli_query("INSERT INTO students_recrod(name,email,address,joining_date) VALUES ('$name', '$email','$address', '$adm')");
}
?>


<!DOCTYPE html>
<html>
<head>
    <title>Sign up form</title>
</head>
<body>
<form action="" method="post" id="">
<label>Name</label><br>
<input type="text" name="name" id=""><br>

<label>Email</label><br>
<input type="text" name="email" id=""><br>

<label>Address</label><br>
<input type="text" name="address" id=""><br>

<label>Admission date</label><br>
<input type="text" name="admission" id=""><br><br>

<input type="submit" name="submit" id="">
</form>
</body>
</html>

mysqli_query excepts 2 parameters , first variable is mysqli_connect equivalent variable , second one is the query you have provided

$name1 = mysqli_connect(localhost,db_username ,db_pswd ,db_name );

$name2 = mysqli_query($name1,"INSERT INTO `counter`.`hits` (`page_hits`) VALUES ('".$hits."')");