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

php 与pdo 数据库连接实例

WBOY
WBOYOriginal
2016-06-08 17:27:591187browse
<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

Statement:
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