* Bugfix: you can actually search the stories now without being slapped by

a MySQL error.  huh, huh.
3-00
Dries Buytaert 2000-06-05 16:07:43 +00:00
parent 595316b004
commit 5bbf24e3a8
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ $terms = stripslashes($terms);
### Compose query:
$query = "SELECT DISTINCT s.sid, s.aid, s.subject, s.time FROM stories s, authors a WHERE s.sid != 0 ";
// Note: s.sid is a dummy clause used to enforce the WHERE-tag.
if ($terms != "") $query .= "AND (s.subject LIKE '%$terms%' OR s.introtext LIKE '%$terms%') ";
if ($terms != "") $query .= "AND (s.subject LIKE '%$terms%' OR s.abstract LIKE '%$terms%' OR s.comments LIKE '%$terms%') ";
if ($author != "") $query .= "AND s.aid = '$author' ";
if ($category != "") $query .= "AND s.category = '$category' ";
if ($order == "Oldest first") $query .= " ORDER BY s.time ASC";