Skip to content

Instantly share code, notes, and snippets.

@tahaghafuri
Created January 27, 2023 12:18
Show Gist options
  • Save tahaghafuri/90936da5fd5ff5cdc1f98abd6d5764a6 to your computer and use it in GitHub Desktop.
Save tahaghafuri/90936da5fd5ff5cdc1f98abd6d5764a6 to your computer and use it in GitHub Desktop.
mysqli_result For PHP
<?php
/*
By tahaghafuri
Link https://github.com/tahaghafuri/mysqli_result
*/
function mysqli_result($res, $row=0, $col=0){
$numrows = mysqli_num_rows($res);
if ($numrows && $row <= ($numrows-1) && $row >=0){
mysqli_data_seek($res,$row);
$resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
if (isset($resrow[$col])) {
return $resrow[$col];
}
}
return false;
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment