$query = "SELECT `uid` FROM `userdata` WHERE `username` = '$username' AND `password` = '$password'";
$query_run = mysqli_query($con, $query);
注意: - $ con = mysqli_connect($ host,$ user,$ pword);
$query_num_rows = mysqli_num_rows($query_run);
$user_id = mysql_result($query_run,0,'uid');//How do convert this line to mysqli_result() function???
答案 0 :(得分:0)
答案是: - 替换
行$user_id = mysql_result($query_run,0,'uid');
与
$row = mysqli_fetch_assoc($query_run);
echo $row['uid'];