Hi there, I have a SQL query that seems to be returning some odd results....
I have this little code snippet:
if (!$result=@$this->mysqli->query("SELECT docs.title, docs.path, docs.added_date, docs.qty, docs.available, docs.author, docs.published_date, docs.active_doc, cat.category from elib_docs AS docs INNER JOIN elib_categories AS cat ON docs.category=cat.id AND docs.active_doc='1' AND docs.title LIKE '%$myquery%' OR docs.author LIKE '%$myquery%' OR docs.added_by LIKE '%$myquery%' OR cat.category LIKE '%$myquery%' OR docs.published_date LIKE '%$myquery%'")) {
$errno=$this->mysqli->errno;
$this->mysqli->close();
trigger_error("AMFPHP Remoting 'elib' class database SELECT query error: " . $errno);
}
Now what I am trying to accomplish is a search option where it will return the results EXCEPT for any documents that are not "active" in the system (bool type with a 1 for active, 0 for not active). Now as it stands, my results are returning the proper search terms, however it is still including the non active ones as well.
I am more of a hobby type coder, so I am sorry if this is a topic covered before.