우선 나는 이미 갔음을 알리고 싶습니다. ALL DUPLICATE 질문. 거기에서 제안 된 변경을 시도했다. PHP- mysqli-> num_rows는 항상 0을 반환합니다. Prepared statements
는 지금까지와 같은 지금은 이미num_rows()
에
num_rows
를 변경하고
store_result();
를 사용
affected_rows()
를 사용하여 시도했다.
:
또한 내가 위의 설명에서 언급 한 바와 같이,
$conn->autocommit(false);
if ($sucess){
$stmt2 = $conn->prepare("UPDATE e_eventqueue SET e_urlfil=? WHERE e_id=?
AND u_id=?");
$stmt2->bind_param("iis",$e_urlfil,$e_id,$u_id);
if($stmt2->execute()){
$stmt2->store_result();
echo "true";
echo $stmt2->num_rows; // <- this always return 0 even when its not
$stmt2->close();
$conn->commit();
}
else{
$conn->rollback();
echo "rollback";
}
}
입니다? MySQL은'UPDATE' 결과가 변경되지 않으면 영향을받은 행을보고 할 수 있습니다. – Phil
업데이트 쿼리의 경우 affected_rows를 확인해야합니다. not num_rows – JYoThI
@Phil 예 phpmyadmin에서 볼 때마다 다른 값을 업데이트 중임 – GeekWithGlasses