Jump to content

gerble1000

New Members
  • Posts

    6
  • Joined

  • Last visited

gerble1000's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok well thank you for sorting this for me. how do i mark this thread as answered
  2. Genius works perfectly. could you please explain why i should not use this code. is it because it puts more pressure on the db
  3. i get this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
  4. is there not a way to do this without altering the tables. surely its possible to just alter this code to do the same job ?
  5. to late. there are thousands already in the database
  6. hi guys im new here and new to php i have this search code in my website that returns the matching search searches. my problem is the script is shit! if the title i am looking for is "Captain America" and i search "captain america" it returns with no issue, but if my title is "Captain.America" then i get no results. i figured i need to tell the script to take these characters in the title "_-." and look at them as spaces. here is the code i got $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('t.fid = '.(int) substr($search, 3)); } else { $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); $query->where('( t.name LIKE '.$search.' )'); } } return $query; could somebody explain as to what i should do please been racking my brain for hours on this i was coming up with ideas like this $search = $this->getState('filter.search'); $search2 = str_replace(' ', '.', $search); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('t.fid = '.(int) substr($search, 3)); } else { $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); $search2 = $db->Quote('%'.$db->getEscaped($search2, true).'%'); $query->where('( t.name LIKE '.$search.$search2.' )'); } } return $query; but this just gave errors
×
×
  • 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.