我有一些問題,我的劇本,我無法準備查詢和腳本好好嘗試一下retrun任何錯誤:無法準備查詢並沒有錯誤輸出今天
表結構(哎呀錯誤的表,校正):
CREATE TABLE IF NOT EXISTS `razorphyn_support_users` (
`id` BIGINT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL,
`mail` VARCHAR(50) NOT NULL,
`password` VARCHAR(200) NOT NULL,
`reg_key` VARCHAR(260) NOT NULL,
`tmp_password` VARCHAR(31) NULL,
`ip_address` VARCHAR(50) NOT NULL,
`status` ENUM('0','1','2','3','4') NOT NULL DEFAULT '3',
`holiday` ENUM('0','1') NOT NULL DEFAULT '0',
`assigned_tickets` INT(5) UNSIGNED NOT NULL DEFAULT 0,
`solved_tickets` BIGINT(11) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY(`mail`))
ENGINE=MyISAM
DEFAULT CHARSET=utf8
AUTO_INCREMENT=55;
Unpreparable字符串:
$query = "SELECT `id` FROM ".$SupportUserTable."
WHERE `status`='2' AND `holiday`='0' AND MIN(`assigned_tickets`)
ORDER BY `solved_tickets` ASC" ;
的完整代碼(在現實中,這只是其中的一部分,$stmt
已經starterd和工作,基本上它已經連接) :
file_put_contents('ok.txt','');
$query = "SELECT `id` FROM ".$SupportUserTable."
WHERE `status`='2' AND `holiday`='0' AND MIN(`assigned_tickets`)
ORDER BY `solved_tickets` ASC" ;
$prepared = $stmt->prepare($query);
if($prepared){
file_put_contents('ok2.txt','');
if($stmt->execute()){
file_put_contents('ok3.txt','');
$stmt->store_result();
$result = $stmt->bind_result($id);
file_put_contents('eafv.txt','id: '.$id);
if($stmt->num_rows>0){
$query = "UPDATE ".$SupportTicketsTable." SET operator_id=?
WHERE id=? ";
if($prepared = $stmt->prepare($query)){
if($stmt->bind_param('ii', $id,$tkid)){
if($stmt->execute()){
echo json_encode(array(0=>'Created'));
}
else
echo json_encode(array(0=>mysqli_stmt_error($stmt)));
}
else
echo json_encode(array(0=>mysqli_stmt_error($stmt)));
}
else
echo json_encode(array(0=>mysqli_stmt_error($stmt)));
}
else
echo json_encode(array(0=>'No Operator Available'));
}
else
echo json_encode(array(0=>mysqli_stmt_error($stmt)));
}
else
echo json_encode(array(0=>$stmt->error));
大聲笑!!!! :D ..... – hek2mgl
有人能否至少激勵減號或我必須死於無知? – Razorphyn
你給這個結構的表沒有'status','holiday','assigned_tickets','resolved_tickets'字段。可能你的$ SupportUserTable有一個像「razorphyn_support_list_tickets」的值?或者你向我們展示了另一張桌子? – zkanoca