Created
April 1, 2015 04:47
-
-
Save sicksand/66d65158000a29c298ae to your computer and use it in GitHub Desktop.
Use this function if you have legacy PHP script < 5.5 that use (mysql_result) to get result from mysql.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* mysql_result.php | |
* | |
* @author Shafiq Mustapa<[email protected]> | |
* @created 1st April 2015 | |
* @version 1.0 | |
* @desc Use this function if you have legacy PHP script < 5.5 that use (mysql_result) to get result from mysql. | |
*/ | |
function mysqli_result($res,$row=0,$col=0){ | |
if ($row >= 0 && mysqli_num_rows($res) > $row){ | |
mysqli_data_seek($res,$row); | |
$resrow = mysqli_fetch_row($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