I've been trying to use the following query to run a search through php onto my MYSQL database:
($srch is put together as "%".$searchText."%" to look for the text anywhere within the values)
---------
"SELECT * FROM a_artists, a_albums, a_labels WHERE a_artists.artistID = a_albums.artistID AND a_albums.labelID = a_labels.labelID AND ((a_artists.artistName LIKE `$srch`) || (a_albums.albumTitle LIKE `$srch`)) ORDER BY albumTitle"
---------
Again, "$srch" is what the user has typed in the search box, with a "%" on each side. I get the following error:
---------
Unknown column '%Blue Dog%' in 'where clause'
---------
"Blue Dog" is what the user typed in the first place. It is not understanding that I'm trying to look for a substring here. Can anyone help me out here??
($srch is put together as "%".$searchText."%" to look for the text anywhere within the values)
---------
"SELECT * FROM a_artists, a_albums, a_labels WHERE a_artists.artistID = a_albums.artistID AND a_albums.labelID = a_labels.labelID AND ((a_artists.artistName LIKE `$srch`) || (a_albums.albumTitle LIKE `$srch`)) ORDER BY albumTitle"
---------
Again, "$srch" is what the user has typed in the search box, with a "%" on each side. I get the following error:
---------
Unknown column '%Blue Dog%' in 'where clause'
---------
"Blue Dog" is what the user typed in the first place. It is not understanding that I'm trying to look for a substring here. Can anyone help me out here??