当在pgadminIII中执行更新语句时,其工作正常错误是更新列值
update tbl_student_colleges set target=false where id=9
Symfony Script值相同时,True处理正常但错误时无法正常工作。
$apptQuery = "insert into tbl_student_colleges (student_id,college_id,college_name,target,applied,accepted,attending,scholarship,created_at,created_by_id,updated_at,updated_by_id) values(:returnID,:collegeId,:collegeName,:target,:applied,:accepted,:attending,:scholarship,:date,:loggedinUser,:date,:loggedinUser)";
$em = $this->getDoctrine()->getEntityManager();
$Querystatement = $em->getConnection()->prepare($apptQuery);
$Querystatement->bindValue('returnID', $returnID);
$Querystatement->bindValue('collegeId', '2472363');//2472363
$Querystatement->bindValue('collegeName', $school->college_name);
$Querystatement->bindValue('target', $school->target == 1 ? TRUE : FALSE);
$Querystatement->bindValue('applied', $school->applied == 1 ? TRUE : FALSE);
$Querystatement->bindValue('accepted', $school->accepted == 1 ? TRUE : FALSE);
$Querystatement->bindValue('attending', $school->attending == 1 ? TRUE : FALSE);
$Querystatement->bindValue('scholarship', $school->scholarship);
$Querystatement->bindValue('date', $date);
$Querystatement->bindValue('loggedinUser', $loggedinUser);
$Querystatement->execute();
答案 0 :(得分:1)
使用0而不是false并查看它是否有效