就mysqli_result()而言,这个mysql_result()的等价物是什么

时间:2014-09-19 09:38:05

标签: php mysqli

$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???

1 个答案:

答案 0 :(得分:0)

答案是: - 替换

$user_id = mysql_result($query_run,0,'uid');

$row = mysqli_fetch_assoc($query_run);
            echo $row['uid'];