SQL that works in MySQL that doesn’t work in PHP

I have done an SQL query that works when I query the database directly:

SELECT COUNT(*) FROM tickets where created = “2022-05-11 13:10:03”

This returns 1 as it should.

In my PHP code that date is stored in a variable so it’s:

SELECT COUNT(*) FROM tickets where created = “$finaldate”

This just returns 0 all the time.

I have checked and when I echo $finaldate it shows 2022-05-11 13:10:03 so I know that is right.

Any ideas?

Thanks.