Reputation: 139
Table page
:
| id | page_title |
| 1 | John_Lennon |
Select:
SELECT * FROM page WHERE LOWER(page_title) = 'john_lennon';
I want to have the row with page_title = 'John_Lennon'
.
I don't know why, but it does not work. In phpmyadmin it returns null
.
Upvotes: 1
Views: 1511
Reputation: 77876
There could be extra spaces present in that column data and so it's not matching. Try using TRIM()
function as well along with LOWER()
like
SELECT * FROM page WHERE TRIM(LOWER(page_title)) = 'john_lennon';
Upvotes: 1