santaclaus 发表于 2018-12-19 12:35:35

2015-03-19 create php alternative for myslq_result in mysqli(PHP)--PDO Tutorial

  来源:http://www.bestwebframeworks.com/tutorials/php/152/create-php-alternative-for-mysql_result-in-mysqli/
  内容:

  If you are migrating from PHP 5.5 to a newer version of PHP - you might be interested in a MySQL to MySQLi/PDO migration guide - and use the function mysql_result() you might get a notice (in case your error_reporting is set to show deprecated warnings) that this function is deprecate. Since there is no 1:1>  代码:
    function mysqli_result($result,$row,$field =0){  
            //adjust the result pointer to that specific row
  
            $result->date_seek($row);
  
            // Fetch rsult array
  
            $data = $result->fetch_array();
  
            return $data[$field];
  
    }
  -----
  PDO Tutorial for Mysql Developers
  来源:http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
  why user pdo?
  mysql_* functions are getting old. For a long time now mysql_* has been at odds with other common SQL database programing interface. It doesn't support modern SQL database concepts such as prepared statements,stored procs,transactions etc...
  connectiong to mysql?
  old way:
  
页: [1]
查看完整版本: 2015-03-19 create php alternative for myslq_result in mysqli(PHP)--PDO Tutorial