Searching a table MySQL & PHP -


I want to be able to use the values ​​from the search string from the URL and display the results through a MySQL table An XML Output

I think I got the formatting and the variable has been declared by the search string.

The problem I have is searching for the whole table, I have seen so for the last reply, and they all have to declare to find each column in the table.

For example, my database layouts are as follows:

  * * Filesindex ** -filename -creation -length -wall -playlocation  

First of all, all of the following will be appropriate:

  $ query = "SELECT * files from where the file name" $ ​​searchterm. "% 'Select Union * files From where to build '' $ Searchterm. "% 'Select Union * from fileindex where the length of' '. $ Searchterm.'% 'Select Union * Files like' WHERE Wall Like ' $ Searchterm Select "% 'Union - Where' Location 'from File Index". $ Searchterm "% '"; Or ideally, there is an easy way in which to find the table contains less hardcoding.  

Any thoughts?

Thanks

Do not use UNION, you and or or . And yes, you need to work hard if you want to keep your code otherwise simple.

  $ query = "Select from files where the file name" ". $ Searchterm." Looks like "% 'or" $. "$ Searchterm."%' Or like '' in length. $ Searchterm. "$ 'Or like wall' '. $ Searchterm." $' Or like location '". $ Searchterm."%' ";  

Comments