Answer the question
In order to leave comments, you need to log in
Error in code, what's the problem?
I'm doing mysql + php lesson, but the following error occurs: Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\OpenServer\domains\test\mysql.php on line 10
Here is the code, I can't understand what error, I paste the code from the lesson, the same thing:
<?php
$link = mysqli_connect('localhost', "root", '', 'test');
if ( !$link ) die("Error");
$query = 'CREATE TABLE users(
login VARCHAR(20),
password VARCHAR(20)
)';
mysqli_query($query);
mysqli_close($link);
?>
Answer the question
In order to leave comments, you need to log in
the error says it all.
we open the dock by function and are surprised to find that we need 2 parameters, but in your code there is only one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question