내 코드를 수정하려면 어떻게해야합니까? 나는이 프로그램을 실행할 때 다음과 같은 오류 메시지가 : PDOStatement에서치명적 오류 : 정의되지 않은 메서드 호출 PDOStatement :: fetch_row()
Fatal error: Call to undefined method PDOStatement::fetch_row() in C:\apache2\Apache2\htdocs\ch\ch32\listing32_2(1).php on line 12
<?php
// Instantiate the mysqli class
$db = new PDO("mysql:host=localhost;dbname=coorporate", "root", "xxxxxxxx");
// Assign the employeeID
$eid = htmlentities($_POST['id']);
// Execute the stored procedure
$result = $db->query("SELECT calculate_bonus('$eid')");
$row = $result->fetch_row();
printf("Your bonus is \$%01.2f",$row[0]);
?>