markduce Posted March 1, 2006 Share Posted March 1, 2006 Hi guys,Heres the situation, my client wants a search facility on the site. I can do this OK, but the problem that I am finding is that as I am searching a database, I have to type every single field in.eg "SELECT * FROM table WHERE name LIKE '%$search%' OR comment LIKE '%$search%'";However, there are 25 fields on this table, and many more thousands on the other tables, so is it possible to search a row rather than a specific column?Thanks in advanceMark Quote Link to comment Share on other sites More sharing options...
oriental_express Posted November 14, 2007 Share Posted November 14, 2007 would be great if someone aswered this as i need to produce a search box that will search the whole table that has 11 attributtes. Is it possible to produce a search box that searches every column and every row ? Quote Link to comment Share on other sites More sharing options...
gin Posted November 14, 2007 Share Posted November 14, 2007 The way I'd do it is to place all the fields into an array, then use a foreach to generate the query. I don't know if there's a way to seach rows like what you suggest. 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.