At least you have to provide some actual problem for someone to help you, instead of a description of what you want to achieve. What do you expect? What do you get? Where do you think is the problem?
Why do you use mysqli AND pdo?
Set your PDO to throw errors.
Also you should consider using Prepared Statements - itâs easy - if you want to protect your database to be deleted by random people.
You are actually sort of on the right track in that you used a prepared statement but you just used it wrong and left out a step. You want something like:
$sql = 'DELETE FROM cpa_report where id = ?';
$stmt = $pdo->prepare($sql);
$stmt->execute([$_GET['id']]);
There is still plenty of stuff to improve. Deleting (or just updating in general) using GET is generally frowned upon. And you will have to spend a bit of time going through the docs to see how prepared statements work.
Looking further, once you have the link and the prepared statement working, before you delete the row from the table, surely youâll need to retrieve the row, get the filename, delete the file, then delete the row? Otherwise youâll end up with a load of orphaned files on the server that have no entry in the database table.