Issue
I understand how to fetch a result in mysqli, but how would this example be coded for mysqli?
$t=mysql_query($query);
return (mysql_result($t, 0) === '1') ? true : false;
The first line is easy, but how do you do the second line?
$t=mysqli_query($mysqli, $query);
return (mysql_result($t, 0) === '1') ? true : false;
I replaced mysql_result with mysqli_result, and it seemed to work, but my editor doesn't recognise mysqli_result as a part of php.
Just want to check that this is the correct way.
Solution
Try
$t=mysqli_query($mysqli, $query);
return (mysqli_result($t, 0) === '1') ? true : false;
function mysqli_result($res, $row, $field=0) {
$res->data_seek($row);
$datarow = $res->fetch_array();
return $datarow[$field];
}
Answered By - vijaykumar Answer Checked By - Mary Flores (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.