SPraus Posted April 19, 2009 Share Posted April 19, 2009 Hey everyone im trying to do a search through a HUGE database for a string but I dont wanna limit it to a single table. This is what I have SELECT DISTINCT * FROM aso WHERE * LIKE %'.$phpstring.'% Can anyone give me help because the * dont work and without it dont work but I dont wanna search every table by sql lol. Please lemme know. SPraus PS sorry if this sounds stupid (now that im thinking of it I think there is a rason but its late so ill still ask lol) Quote Link to comment Share on other sites More sharing options...
soak Posted April 19, 2009 Share Posted April 19, 2009 Are all the fields from one table? If so you can do: WHERE field1 LIKE "%'.$phpstring.'%" OR field2 LIKE "%'.$phpstring.'%" OR field3 LIKE "%'.$phpstring.'%" OR field4 LIKE "%'.$phpstring.'%" If you need to search various tables you can accomplish this with a union statement or possibly a join depending on what data you want to retrieve. Quote Link to comment Share on other sites More sharing options...
SPraus Posted April 19, 2009 Author Share Posted April 19, 2009 Thank you for the responce. Lets see they are all in one table but anoter problem came up so I just changed the search type (just to one area) then being that most the tags were the same I created a dropdown box. But thank you sou much for the help. SPraus Quote Link to comment 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.