I know this is really a mySQL question, but I have been searching unsuccessfully for several hours to find an answer and I suspect you probably know the answer.
I have two types of queries, one simply lists all the records and displays certain fields from those records. Earlier today, I sent you a copy of the script after modifying it to try to get the Dataface valuelists picked up in the query per your instructions.
The second query is a search based on variables entered by the user, such as keywords and dates.
I have added another field to the table to enable the authors to indicate whether or not an article is complete and should be published. If the field is set to "DoNot" then the article is not published. If set to "Do" the article is published.
I've added a WHERE Publish="Do" in my query to restrict the results to those records with the field set to "Do" and this works fine in the first type of query. Here is the query:
$res = mysql_query('SELECT * FROM Enhancements WHERE Publish="Do" ORDER BY IWSys') or die(mysql_error());
The second type of query already has a "Where" clause in it:
$query = "select * from Enhancements WHERE Integrated like \"%$trimmed%\" order by IWSys";
My problem is I can not figure out how to add a second "where" to restrict the results to published articles only. I have tried the following without success:
..."select * from Enhancements WHERE Publish="Do" AND WHERE Integrated like...
..."select * from Enhancements WHERE Publish="Do" AND Integrated like...
..."select * from Enhancements WHERE (Publish="Do" AND Integrated like...)
Can you help me out with this, please. Thank you.
Michael Wassil