ribeiro Posted June 15, 2021 Share Posted June 15, 2021 (edited) So basically my select is giving me results that I don't want , please take a look at it , if you can help me I would appreciate it thank you. Im searching for something with the letter j in it , be it the user or the nome_proprio row it gives me this: heres the code aswell As you can see I just want where user LIKE '$procura' , i had the ,OR nome_proprio LIKE '$procura' , but it just gives more posts come from here : If you need something more like the code itself , i can provide it Thank you for your time and help:D Edited June 15, 2021 by ribeiro Quote Link to comment https://forums.phpfreaks.com/topic/312917-i-need-help-with-my-select-on-my-search-box/ Share on other sites More sharing options...
Solution requinix Posted June 15, 2021 Solution Share Posted June 15, 2021 You entered "j" and it's listing records with user containing "j". So I don't see what's wrong with that. Are you talking about getting all those duplicates? It's because you're joining the login and dados_user tables together without telling MySQL how to join them together. You need a query that looks like SELECT login.user, dados_user.nome_proprio FROM login JOIN dados_user ON login.??? = dados_user.??? WHERE login.user LIKE '%$procura%' AND login.eliminado = 0 1 Quote Link to comment https://forums.phpfreaks.com/topic/312917-i-need-help-with-my-select-on-my-search-box/#findComment-1587250 Share on other sites More sharing options...
ribeiro Posted June 15, 2021 Author Share Posted June 15, 2021 56 minutes ago, requinix said: You entered "j" and it's listing records with user containing "j". So I don't see what's wrong with that. Are you talking about getting all those duplicates? It's because you're joining the login and dados_user tables together without telling MySQL how to join them together. You need a query that looks like SELECT login.user, dados_user.nome_proprio FROM login JOIN dados_user ON login.??? = dados_user.??? WHERE login.user LIKE '%$procura%' AND login.eliminado = 0 Thank you so much it was actually that. I didn't know of JOIN , thank you for intruducing me to it aswell . Thank you so much Quote Link to comment https://forums.phpfreaks.com/topic/312917-i-need-help-with-my-select-on-my-search-box/#findComment-1587252 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.