用虚拟机 linux +nginx+oracle+php pdo连不上数据库
Fatalerror:Uncaughtexception'PDOException'withmessage'SQLSTATE[HY000]:OCISessionBegin...
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: OCISessionBegin: Error while trying to retrieve text for error ORA-21561 (/root/server_soft/php-5.5.22/ext/pdo_oci/oci_driver.c:686)' in /mnt/hgfs/workspaces/store/Storesys.Lib/Q/Db/Pdo/Core.php:136 Stack trace: #0 /mnt/hgfs/workspaces/store/Storesys.Lib/Q/Db/Pdo/Core.php(136): PDO->__construct('oci:dbname=//19...', 'store', 'store', Array) #1 /mnt/hgfs/workspaces/store/Storesys.Lib/Q/Db/Pdo/Core.php(357): Q_Db_Pdo_Core->_connect(true) #2 /mnt/hgfs/workspaces/store/Storesys.Lib/Q/Db/Pdo/Client.php(28): Q_Db_Pdo_Core->_doFetch('select * from u...', Array, NULL, 'fetchRow') #3 /mnt/hgfs/workspaces/store/Storesys.Lib/Passport/Models/Auth/Dao.php(40): Q_Db_Pdo_Client->fetchRow('select * from u...', Array) #4 /mnt/hgfs/workspaces/store/Storesys.Lib/Passport/Models/Auth/Client.php(47): Passport_Models_Auth_Dao->getAuth('admin', '1') #5 /mnt/hgfs/workspaces/store/Storesys.Web/application/controllers/Login.php(47): Passport_Models_Auth_Client::getAuth( in /mnt/hgfs/workspaces/store/Storesys.Lib/Q/Db/Pdo/Core.php on line 152报的这个错,
展开
1个回答
2015-04-29
展开全部
PDO默认的错误处理模式是静默模式,即出了错不会报错的;你可以用PDO::setAttribute(
PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING)设置为警告模式,就会报错了;
但是这里报的错误是指语法错误;所以DELETE、INSERT、 或 UPDATE都用受影响的行数来进行判断;返回0,表示不成功;PDOStatement::rowCount()
PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING)设置为警告模式,就会报错了;
但是这里报的错误是指语法错误;所以DELETE、INSERT、 或 UPDATE都用受影响的行数来进行判断;返回0,表示不成功;PDOStatement::rowCount()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询