taz321 Posted March 11, 2008 Share Posted March 11, 2008 Hi I have an search facility in place, but it doesn't seem to be working, any ideas why ? My code below is - if (($_GET['keyword'] == "") || ($_GET['category'] == "*")) { $query = "SELECT * FROM form ORDER BY formID DESC LIMIT $offset, $limit"; } else { $query = "SELECT * FROM form WHERE ".$_GET['category']." like '%".$_GET['keyword']."%' ORDER BY formID"; } $result = mysql_query($query, $connection) or die ("Unable to perform query $query"); <form method="get" action="enquiryscreen.php" name="search"> <table width="1207" border="0"> <tr> <td width="285"><div align="center"><span class="style20">Welcome <?php echo $_SESSION['firstname']?> <?php echo $_SESSION['surname']?></span></div></td> <td width="14"> </td> <td width="123"> </td> <td width="154"> </td> <td width="8"> </td> <td width="117"> </td> <td width="181"> </td> <td width="291"> </td> </tr> <tr> <td height="71"> </td> <td> </td> <td><span class="style24">Search By Keyword</span></td> <td><input name="keyword" type="text" id="keyword"></td> <td> </td> <td><span class="style24">Search By Category</span></td> <td><select name="category" class="title" id="category"> <option value="*">Please Select</option> <option value="formID">Enquiry Number</option> <option value="issuetitle">Issue Title</option> <option value="datesubmitted">Date Submitted</option> <option value="systemaffected">System Affected</option> <option value="teamname">Team</option> </select></td> <td><div id="Layer6"><img src="Images/Symbol.jpg" width="135" height="129"></div></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> <div align="right"> <input name="Clear" type="reset" class="style8" id="Clear" value="Clear"> </div></td> <td> </td> <td><input name="Search" type="submit" class="style8" id="Search" value="Search"></td> <td> </td> <td> </td> </tr> <tr> <td height="20"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> Thanks Link to comment https://forums.phpfreaks.com/topic/95696-search-is-not-working/ Share on other sites More sharing options...
trq Posted March 11, 2008 Share Posted March 11, 2008 Can you be more vague? Link to comment https://forums.phpfreaks.com/topic/95696-search-is-not-working/#findComment-489941 Share on other sites More sharing options...
Demonic Posted March 11, 2008 Share Posted March 11, 2008 What he means is, can you give a better description of the errors your getting and what you want help with fixing.. Link to comment https://forums.phpfreaks.com/topic/95696-search-is-not-working/#findComment-489952 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.