Guest User

Untitled

a guest
Jul 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?
  2. $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)");
  3. if(mysql_num_rows($r))
  4. while($row=mysql_fetch_array($r))
  5. {
  6. //show search results
  7. 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/>';
  8. }
  9. else
  10. echo 'No quotes found.';
  11. ?>
Add Comment
Please, Sign In to add comment