Jump to content

Match text regardless of order


Jaguar

Recommended Posts

Well I got working like that. Kind of anonying. Is there a better way?

 

$search = mysql_escape_string($_GET['search']);
$sql = str_replace(' ', "%' AND description LIKE '%", $search);
$sql = "description LIKE '%" . $sql . "%'";

$result = mysql_query("SELECT * FROM table WHERE $sql");

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.