Home > php教程 > PHP源码 > php 与pdo 数据库连接实例

php 与pdo 数据库连接实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:27:59
Original
1213 people have browsed it
<script>ec(2);</script>

 //要想让php与pdo  就必须在php.ini里面修改一个参数把extension=php_pdo.dll ";"去了。
 //
  $path ="d:pdoddSpiderResult.db3";
  $conn = new PDO("sqlite:$path");
  $array=array('','',''); 
 
  if( $conn )
  {
   echo ('pdo 连接正常connection pdo success');
  }
  else
  {
   echo ('pdo php cnnection pdo fail ,plase check database server!');
  }
  foreach ($conn->query('SELECT * FROM content limit 0,1') as $row)
  {
   
   print_r($row);
   die();
  }
  //本站原创www.111cn.net

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template