0

hey everyone i have this data in my database

and where i try to execute this SQL commande

SELECT * FROM `adherent` WHERE nom="arfaoui"

it returns this empty results enter image description here

can anyone helps me !!!!

6
  • 1
    Is there also whitespace in that field? Commented Apr 27, 2017 at 19:03
  • no i've make sure there is nothing and iv'e try a million time with different names and same results everytime Commented Apr 27, 2017 at 19:04
  • 1
    can you get result of SELECT * FROM adherent Commented Apr 27, 2017 at 19:04
  • yes i can get results when iv execute SELECT * FROM adherent Commented Apr 27, 2017 at 19:05
  • 1
    Try TRIM(). SELECT * FROM adherent WHERE TRIM(nom)="arfaoui" Commented Apr 27, 2017 at 19:08

2 Answers 2

3

Try this query:

SELECT nom, LENGTH(nom)
FROM `adherent` 
WHERE nom LIKE "%arfaoui%"

It will return that row along with number of characters. That should help finding out whether it contains whitespace or any other characters.

Sign up to request clarification or add additional context in comments.

4 Comments

it work's thanks i find out that whenever i try to add data using java ive add a blank space in the end thanks you've saved me
you have to accept the answer if that help you @GhassenArfaoui not just say thank you :)
Sorry @ YCF_L i did not get what you want to say !! .
@GhassenArfaoui read this to undersatanf more meta.stackexchange.com/questions/5234/…
1

try this :

SELECT * FROM adherent WHERE nom=" arfaoui"

1 Comment

it work's thanks i find out that i have add a blank space in the end a simple mistake can damage a whole program thanks <3

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.