I am slowly converting pages of a website where there is MSQLI to PDO. But I have this section of a login script which I am not to sure if it can be done in PDO and if it can't does anyone have any recommendations on how to make it secure. It relates to the section of code below, it is a multi-query which relates to $pass_fail variable and then a single select query $pass_fail_query variable which I can probably work out. But its the multi query I struggle with when using PDO how do I execute it?
$pass_fail = "
DELETE FROM `login_fail`
WHERE
`last_fail_login` < DATE_SUB(NOW(), INTERVAL 5 MINUTE);
";
$pass_fail .= "
INSERT INTO login_fail (
user_id,
email,
last_fail_login,
fail_login_ip
) VALUES (
'$user_id',
'$email',
'$last_login_date',
'$ip'
);
";
$pass_fail .= "
UPDATE members SET
`last_fail_login` = '$last_login',
`fail_login_ip`= '$ip'
WHERE
email = '$email'
";
$pass_fail_query = "
SELECT
*
FROM `login_fail`
WHERE
`email` = '$email'
AND `last_fail_login` > date_sub(now(), interval 5 minute)
";