I am working in PHP with PDO. The problem I am having is:
I have a table called products. It has a column named product_name
. Here are some examples of the name of products
product_name
----------
Bfilet de bœuf entier
Bar de ligne
Saumon entier
Beurre
So when I execute the query
select * from products where product_name='beurre'
It works fine. It returns the corresponding line.
But if I do:
select _ from products where product_name='Saumon entier'"
It does not return any result. There seems to be a problem when there are spaces involved!
And another unusual thing is that I don't seem to be having this problem on the SQL Command line, only when I use PHP to retrieve the data.
Could someone explain to me why and offer a solution?