期望至少2个参数,给定1个问题

时间:2019-12-24 04:54:46

标签: php

  1. 嗨,我对此代码有疑问,这是发出的警告,

警告:mysqli_query()至少需要2个参数,第7行的C:\ xampp \ htdocs \ projek \ admin \ prosesadduser.php中给出1个参数

警告:mysqli_num_rows()期望参数1为mysqli_result,在第7行的C:\ xampp \ htdocs \ projek \ admin \ prosesadduser.php中给出空值

警告:mysqli_query()至少需要2个参数,第15行的C:\ xampp \ htdocs \ projek \ admin \ prosesadduser.php中给出1个参数

  1. 这是我的代码
<?php
include 'session.php';
$username = $_POST['username'];
$password = $_POST['password'];
$fullname = $_POST['fullname'];

$result = mysqli_num_rows(mysqli_query("SELECT * FROM user WHERE USER_USERNAME='$username'"));

if($result == 1)
{
echo '<h1>ERROR!</h1>The username you have chosen already exists!';
}
else
{
mysqli_query("INSERT INTO user (USER_USERNAME, USER_PASSWORD, USER_FULLNAME)
VALUES ('$username','$password','$fullname')");
echo

?>

有人可以帮我吗?

0 个答案:

没有答案