Here is my code [code]// counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $keywords = explode(" ", $search); $query = "SELECT * FROM articles " . "WHERE body LIKE '%".$keywords['0']."%'"; for ($i=1; $i<count($keywords); $i++) { $query = $query." AND body LIKE '%".$keywords[$i]."%'"; } $query = $query." ORDER BY id DESC LIMIT $offset, $rowsPerPage"; $result2 = mysql_query($query) or die(mysql_error()); ?> <form method="GET" action="search.php"> <b>Search:</b> <input type="text" name="search" size="20" /> <input type="submit" value="Search!" /> </form><br><br> <table width="50%" style="border:1px solid #000000;"> <?php $keywords = explode(" ", $search); $query = "SELECT COUNT(id) AS numrows FROM articles " . "WHERE body LIKE '%".$keywords['0']."%'"; for ($i=1; $i<count($keywords); $i++) { $query = $query." AND body LIKE '%".$keywords[$i]."%'"; } $result = mysql_query($query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage);[/code] But I would also like to search both 'body' and 'title'. Due to syntax issues, and not knowing which exact line to edit, I have failed at trying to get it to search both rows. Thanks in advanced to anyone who can help me with this.