简体   繁体   English

就mysqli_result()而言,此mysql_result()的等效项是什么?

[英]What is the equivalent of this mysql_result() in terms of mysqli_result()

$query = "SELECT `uid` FROM `userdata` WHERE `username` = '$username' AND `password` = '$password'";
$query_run = mysqli_query($con, $query);

Note :- $con = mysqli_connect($host, $user, $pword); 注意:-$ 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???

The answer is :- replace the line 答案是:-更换线

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

with

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM