Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $r=mysql_query("SELECT *,MATCH(`quote`,`author`,`category`) AGAINST('".mysql_real_escape_string($_GET['q'])."' IN BOOLEAN MODE) FROM `quotes` WHERE MATCH(`quote`,`author`,`category`) AGAINST('".mysql_real_escape_string($_GET['q'])."' IN BOOLEAN MODE)");
- if(mysql_num_rows($r))
- while($row=mysql_fetch_array($r))
- {
- //show search results
- echo '<a href="/quote/'.$row['id'].'/">'.$row['quote'].'</a><p align="right">More quotes in <a href="/category/'.str_replace(' ','_',$row['category']).'">'.$row['category'].'</a>. More quotes by <a href="/author/'.str_replace(' ','_',$row['author']).'">'.$row['author'].'</a>.</p><hr><br/>';
- }
- else
- echo 'No quotes found.';
- ?>
Add Comment
Please, Sign In to add comment