prepare("select 3304_posts.id,3304_posts.title,3304_forumcats.catid,3304_forumcats.catname from 3304_posts,3304_forumcats where (3304_posts.title like '%$search%' or 3304_posts.post like '%$search%' or 3304_forumcats.catname like '%$search%') and 3304_posts.catid = 3304_forumcats.catid"); //exact $sql->execute(); $numresults = 0; while ($row=$sql->fetch()){ $postid = $row[0]; $posttitle = $row[1]; $catid = $row[2]; $cattitle = $row[3]; $message .= 'Read Post '.$posttitle.'
click here to read all posts from '.$cattitle.'

'; $numresults++; } if ($numresults == 0){ $match = $dbh->prepare("select id,title from 3304_posts where match(post) against ('$search')"); $match->execute(); while ($matchrow = $match->fetch()){ $postid = $matchrow[0]; $posttitle = $matchrow[1]; $message .= 'Read Post '.$posttitle.'

'; $numresults++; } } echo 'Your search for \''.$search.'\' generated ('.$numresults.') results

'; echo $message; } ?>
Search: