Jump to content

mirkan03

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by mirkan03

  1. I wanted that searched words are included in headline or within whole (text)... Im not sure, but your code is not what I need, friend!!! It will work only if searched word and tables (headline or whole) are equal! I need to upgrade my function so I can find result if I seek for 2 or more words..Its working perfect as it is now, but only for 1 word!!!
  2. Hello to all people on forum. I built web site with large database of some texts and for easier finding what you need on it, I wanted to include search engine! I built it, but it only works accurate with one word. Problem is when I want to search few word! If they are separated or in different order, search is failure. Here's my code: function trazi($table,$search) { $sve = mysql_query("SELECT id,headline,whole FROM $table ORDER BY id DESC"); $data = ""; while($tmp = mysql_fetch_array($sve)) { if(stristr($tmp['headline'], $search) || stristr($tmp['whole'], $search)) { $data .= '<a href="www.mysite.com/' . $table . '_cur.php?id=' . $tmp[0] . '" target="_blank" style=" text-decoration:none; color:#1A5C1F; font-size: 13px;">'; $data .= '<p>' . $tmp[1] . '</p>'; $data .= '</a>'; } } return $data; } So, I want search to be success only if ALL words can be found in headline OR in whole (text)!! Can you help me modify my code?! Thx anyway!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.