0

enter image description here

I want to display only the specific user details as shown in link. For kind information, I just want to say that I am using php and mysql and need to display 'user2' details from that previous table(customer) given as picture link].help with valuable suggestion.

4
  • if I use sql- SELECT id,rcvusr FROM xyz WHERE rcvusr='user2' ORDER BY eid desc LIMIT 10. it display only 2 records(id 13 and 14) Commented Nov 20, 2013 at 11:32
  • 2
    Hello, Jaywalker anti-pattern! //Hint: do not store multiple values in one column Commented Nov 20, 2013 at 11:33
  • try sql like -- SELECT id,rcvusr FROM xyz WHERE rcvusr like '%user2%' ORDER BY eid desc LIMIT 10 Commented Nov 20, 2013 at 11:34
  • Dear Aneesh, Thanks. It's good, atleast i can make it on my way. Thanks once again. Commented Nov 20, 2013 at 11:42

2 Answers 2

1

Try this

SELECT id,rcvusr FROM xyz WHERE rcvusr like 'user2%' ORDER BY eid desc LIMIT 10 
Sign up to request clarification or add additional context in comments.

Comments

0
Select id, sndusr, SUBSTRING_INDEX(rcvusr, '@@', 1), title
From xyz
Where rcvusr = 'user2' or
    rcvusr like 'user2@@%' 

Here is the documentation : http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.