PHP面向对象连接数据库_PHP_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > PHP > PHP面向对象连接数据库

PHP面向对象连接数据库

 2012/9/8 11:53:48  czgcyujian  程序员俱乐部  我要评论(0)
  • 摘要:转载自:http://www.yoewan.com/php-object-oriented-connect-to-the-database.html更多内容:yoewan分享,Flash教程,JSLF教程PHP通过面向对象的方式连接数据库$db=newmysqli('localhost','user','pwd','yoewan.com');if(mysqli_connect_errno()){echo'connecttodatabaseerror';exit;
  • 标签:PHP 数据库 数据 连接
转载自:http://www.yoewan.com/php-object-oriented-connect-to-the-database.html
更多内容:yoewan分享,Flash教程,JSLF教程
PHP通过面向对象的方式连接数据库

$db=new mysqli('localhost','user','pwd','yoewan.com');
   if(mysqli_connect_errno()){
      echo 'connect to database error';
      exit;
   }
   $sql="select yoewan from yoewan.com";
   $rs=$db->query($sql);
   $num=$rs->num_rows;
标签:yoewan.com,PHP连接数据库,PHP面向对象连接数据库
发表评论
用户名: 匿名