PDA

View Full Version : SQL Can not find the data with leters, but numbers is OK.


sjmotos
12-17-2016, 06:54 AM
Hi my english is poor, excuse.

I am getting into this world and I need your help.
In my test page I have problems logging in, only result with numbers / Do not result in letters.
Should I put some "extra" in SQL for letters? What do I have to do to find the value?
With numbers I find, with no letters, I place the images where it is clearly seen.
Very grateful for your help, greetings from Chile.

SELECT `user`, pass FROM registrousuarios WHERE `user`=%s AND pass=%s

https://s28.postimg.org/7q48uz8st/1_registro.jpg
https://s28.postimg.org/5zl7thr9p/image.jpg
https://s28.postimg.org/60v5mwt3h/image.jpg
https://s28.postimg.org/juok92s0d/image.jpg

edbr
12-18-2016, 12:02 AM
'a' and. 'b'

sjmotos
12-19-2016, 04:00 AM
I have solved it by changing "the" SQL, thank you very much for the help !! 0=poor 1=good


0 SELECT `user`, pass FROM registrousuarios WHERE `user`=%s AND pass=%s

1 SELECT `user`, pass FROM registrousuarios WHERE `user`='%s' AND pass=%s

edbr
12-19-2016, 04:52 AM
good, are you using prepared statements? it is more secure against sql injections