When to use single quotes, double quotes and backticks in MySQL/PHP?
Hello everyone! I just started learning PHP and MySQL, and I'm constantly confused about quotes. There seem to be single ('), double (") and backticks (`). I don't understand when to use which, and I keep getting errors.\n\nFor example, here's my code:\n\n```php\n$name = "Ivan";\n$query = "SELECT * FROM users WHERE name = '$name'";\n```\n\nThis works. But if I write like this:\n\n```php\n$query = 'SELECT * FROM users WHERE name = "$name"';\n```\n\nThen the variable is not interpolated. And if I use backticks:\n\n```php\n$query = "SELECT * FROM `users` WHERE `name` = 'Ivan'";\n```\n\nThis also works, but I don't understand why they are needed.\n\nAlso, I've seen some people use double quotes for table and column names:\n\n```php\n$query = "SELECT * FROM \"users\" WHERE \"name\" = 'Ivan'";\n```