// 使用PDOStatement对象$result将所有结果数据放到一个数组中 $rows = $result->fetchAll(); print_r($rows);错误提示: Warning: require_once(Zend/Config.php) [function.require-once]: failed to open stream: No such file or directory in E:\web\haihalie\index.php on line 4Fatal error: require_once() [function.require]: Failed opening required 'Zend/Config.php' (include_path='.;C:\php5\pear') in E:\web\haihalie\index.php on line 4 我想是不是需要在php.ini文件里面配置一下include_path, 于是找到这个参数,把我的zend Framework框架地址给加进去,配置如下:include_path = ".;D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib" 会出现如下错误。 Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php:107 Stack trace: #0 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Abstract.php(417): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php(230): Zend_Db_Adapter_Abstract->query('select * from k...', Array) #2 E:\web\haihalie\index.php(37): Zend_Db_Adapter_Pdo_Abstract->query('select * from k...') #3 {main} thrown in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php on line 107搞不清楚了, 希望大侠指点一二。
require_once 'Zend/Config.php';
require_once 'Zend/Db.php';
require_once 'Zend/Date.php';
// 数据库配置信息
$configArray = array(
'webhost' => 'www.example.com',
'database' => array(
'adapter' => 'pdo_mysql', //注意,你的PHP需要支持这个扩展,也可以换成其他类型的扩展
'params' => array(
'host' => 'localhost',
'username' => 'root',
'password' => 'admin',
'dbname' => 'krhm'
)
)
);
// 将配置信息对象化
$config = new Zend_Config($configArray);
// 打印其中一个属性值
echo $config->webhost;
// 读取配置信息,建立数据库链接
$db = Zend_Db::factory($config->database);
// 设置数据链接语言
//$db->query('SET NAMES GBK');
// 查询数据库保存的内容
$sql = "select * from kr_sys_user";
$result = $db->query($sql);
// 使用PDOStatement对象$result将所有结果数据放到一个数组中
$rows = $result->fetchAll();
print_r($rows);错误提示:
Warning: require_once(Zend/Config.php) [function.require-once]: failed to open stream: No such file or directory in E:\web\haihalie\index.php on line 4Fatal error: require_once() [function.require]: Failed opening required 'Zend/Config.php' (include_path='.;C:\php5\pear') in E:\web\haihalie\index.php on line 4
我想是不是需要在php.ini文件里面配置一下include_path, 于是找到这个参数,把我的zend Framework框架地址给加进去,配置如下:include_path = ".;D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib" 会出现如下错误。
Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php:107 Stack trace: #0 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Abstract.php(417): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php(230): Zend_Db_Adapter_Abstract->query('select * from k...', Array) #2 E:\web\haihalie\index.php(37): Zend_Db_Adapter_Pdo_Abstract->query('select * from k...') #3 {main} thrown in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php on line 107搞不清楚了, 希望大侠指点一二。