Jump to content

php/sql search


hasek522

Recommended Posts

hey so i have a search engine i have made that uses FULLTEXT

it is located on hairneedhelp.net  if you want to check it out, anyways it searches city among other things but a couple of the people have La Canada as their city but if i search for "La Canada" it does not show up.  However if i search for "Montrose" that search works fine.  Any ideas how to fix this?

Here is my code:

$search = $_POST['search'];

$search = '%' . $search . '%';

$db = mysql_connect($dbhost, $dbuser, $dbpassword);

mysql_select_db($dbdatabase, $db);

$search = mysql_real_escape_string($search);

$sql = "SELECT * FROM stylists WHERE MATCH(firstname, lastname,address, city, salon, specialty) AGAINST ('" . $search . "');";

$query = mysql_query($sql);

Link to comment
https://forums.phpfreaks.com/topic/120962-phpsql-search/
Share on other sites

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.