( ! ) Warning: mysqli_query() expects at least 2 parameters, 1 given in D:\Zend\mall\register.php on line 50 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0006 | 253408 | {main}( ) | ..\register.php:0 |
2 | 0.0024 | 262832 | mysqli_query ( ) | ..\register.php:50 |
( ! ) Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in D:\Zend\mall\register.php on line 51 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0006 | 253408 | {main}( ) | ..\register.php:0 |
2 | 0.0045 | 263440 | mysqli_fetch_assoc ( ) | ..\register.php:51 |
<?php
if (!empty($_POST['username']))
{
// include_once './lib/fun.php';
$username=trim($_POST['username']);
$password=trim($_POST['password']);
$repassword=trim($_POST['repassword']);
if(!$username)
{
echo '用户名不能为空';
exit;
}
if(!$password)
{
echo '密码不能为空';
exit;
}
if(!$repassword)
{
echo '确认密码不能为空';
exit;
}
if($password!==$repassword)
{
echo '两次输入密码不一致,请重新输入';
exit;
}
$con= mysqli_connect('127.0.0.1','root','123456','imooc_mall');
if(!$con)
{
echo mysql_error();
exit;
}
};
//判断用户是否在数据表存在
$sql="SELECT COUNT('id')
FROM `im_user`
WHERE 'username'='{$username}'";
$obj=mysqli_query($sql);
$result=mysqli_fetch_assoc($obj);
var_dump($result);die;
宣言的言