这是我的表
CREATE TABLE users(name text,password text);
insert into users('ali','123456');
现在,当我想在php代码中选择我的行时,名称上有错误,我的问题是什么 我认为在这段代码中应该打印好,但打印在用户上,我的问题是什么???
<?php
$db_name="my db name";
$mysql_user="my user";
$server_name="my server name";
$con=mysqli_connect($server_name,$mysql_user,"123456",$db_name);
$user="ali";
$password="123456";
$sql1="Select name,password from users where name='ali'";
$result=mysqli_query($sql1);
$r=mysqli_fetch_array($result);
if($r[0]=="")
{print "on user";}
else if($password!=$r[1])
{print "error password";}
else
print "ok";
mysqli_close($con);
?>