PHP Classes

PHP MySQL to MySQLi

Recommend this page to a friend!

      PHP MySQL to MySQLi  >  PHP MySQL to MySQLi package blog  >  How to Convert MySQL ...  >  All threads  >  PHP MySQL to MySQLi  >  (Un) Subscribe thread alerts  
Subject:PHP MySQL to MySQLi
Summary:Congratulations! add mysql_result conversion solved
Messages:1
Author:Henrique Soares Barbosa
Date:2017-07-21 18:17:54
 

  1. PHP MySQL to MySQLi   Reply   Report abuse  
Picture of Henrique Soares Barbosa Henrique Soares Barbosa - 2017-07-21 18:17:54
Congrats on this A+ article that helped me on migrating old php code do version 7 tested in ubuntu 16.04 server/LAMP;

one more function that helped me i found at another site and would like to share: mysql_result can be solved like this:

//php7
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;
}