MySQL query to get user where email equals some variable
mysql, php, sql-like
Solution
Your PHP code seems unrelated to your problem, but it sounds like you want `email = 'dipesh@'`, which matches `dipesh@` literally. If you want `dipesh@` followed by anything, use `email LIKE 'dipesh@%'`. The `%` is a wildcard meaning "match zero or more of any character."
Problem
First of all i don't know where to start doing this. That's why i am posting this question. Maybe you guys go for down-vote or close or flag it. Here is the problem. ``` <?php $gmail = "dipesh@some.com" $split = explode('@',$service['User']['email']); ?> ``` The code above outputs an array with two elements inside it: one for `dipesh` and other for `some.com`. That is correct as expected. Now I want a `MySQL` query that will perform `select query` to get record for `dipesh@.` Example ``` SELECT * FROM users WHERE users.email LIKE 'dipesh'; ``` The code above returns all the records that contain `dipesh`, but I want only the ones that contain `dipesh@`. Does `SELECT * FROM users WHERE users.email LIKE '%dipesh';` work? If it does then what is the difference between the two? Thanks