function get_actor_info( $actor_id ) {
global $pdo;
$stmt = $pdo->prepare('
SELECT film_info, first_name, last_name
FROM actor_info
WHERE actor_id = :actor_id
LIMIT 1');
$stmt->execute( array( ':actor_id' => $actor_id ) );
return $stmt->fetch( PDO::FETCH_OBJ );
}
在上面的示例中为什么 MYSQL 选择 WHERE...:actor_id
后跟此:
列和return $stmt->fetch( PDO::FETCH_OBJ );
为什么使用双列中的相同内容?