2012-01-11 64 views
-2

我的查询出错了 服务器遇到内部错误或配置错误,无法完成您的请求。内部服务器错误Zend查询

请联系服务器管理员@@ ServerAdmin @@并告知他们错误发生的时间以及您可能已经犯的任何可能导致错误的事情。

有关此错误的更多信息可能在服务器错误日志中可用。

$sql = $db->query(
"INSERT INTO users (user_id, title, first_name, last_name, user_identity_id, email_id, password, office_phone_number, public_id, session_id, address_id, created_by, last_modified_by, created_on, last_modified_on, is_activated, is_deprecated, middle_name, cell_phone_number, superviser_name, superviser_email, superviser_phone_number) 
VALUES(:p_user_id,:p_title,:p_first_name,:p_last_name,:p_user_identity_id,:p_email_id,:p_password,:p_office_phone_number,:p_public_id,:p_session_id,:p_address_id,:p_created_by,:p_last_modified_by,:p_created_on,:p_last_modified_on,:p_is_activated,:p_is_deprecated,:p_middle_name,:p_cell_phone_number,:p_superviser_name,:p_superviser_email,:p_superviser_phone_number)", 
array(
'p_user_id' => '', 
'p_title' => $title, 
'p_first_name' => $first_name, 
'p_last_name' => $last_name, 
'p_user_identity_id' => '', 
'p_email_id' => $email, 
'p_password' => $pass, 
'p_office_phone_number' => $office_ph_no, 
'p_public_id' => '', 
'p_session_id' => '', 
'p_address_id' => '', 
'p_created_by' => '', 
'p_last_modified_by' => '', 
'p_created_on' => '', 
'p_last_modified_on' => '', 
'p_is_activated' => '', 
'p_is_deprecated' => '', 
'p_middle_name' => $middle_name, 
'p_cell_phone_number' => $cell_ph_no, 
'p_superviser_name' => $supervisor_name, 
'p_superviser_email' => $supervisor_email, 
'p_superviser_phone_number' => $supervisor_ph_no 
) 
); 
$db->commit(); 
+0

请看一看错误日志和更新你的问题。 – ZeroSuf3r 2012-01-11 14:37:40

回答

0

这看起来像你正试图在Zend中使用命名参数执行PDO语句。

首先要检查,我假设你已经开始交易?

此外,根据我的经验,命名参数在查询中与在params数组中相同,例如, :参数1是$params = array(':param1'=>'data');

我用作为ZF文档"executing a statement using named parameters"相同的方法:

$select = 'select col1,col2 from my_table where con1=:param1 and con2=:param2'; 
$params = array(
    ':param1'=> 'somedata', 
    ':param2'=> 'someotherdata' 
); 
$statement = new Zend_Db_Statement_Pdo($db,$sql); 
if($statement->execute($params)){ 
    //ok! 
}