Mr. Happiness,
That seemed to work - I reworked my code a bit and had to do this:
$query = sprintf("SELECT * FROM data_array WHERE type ='%s' OR author ='%s' OR subject1 ='%s' OR subject2 ='%s'", mysql_real_escape_string($searchtopic), mysql_real_escape_string($searchtopic), mysql_real_escape_string($searchtopic), mysql_real_escape_string($searchtopic));
Because the sprintf function wants a string variable for each '%s' ... no big deal - I guess ...
But here's the next problem. In the fields subject1 and subject two there are a series of subjects presently separated by commas so a book might look like this
subject1
fantasy, adventure, young adult
subject2
scorcery, magic, wizard, witch
How do I get the search to accept only 1 of these. The way it presently works, the entire subject1 or subject2 field has to be exact for the search to pull back that row as a result. Any ideas?