Jump to content

SQL Query Question


hasek522

Recommended Posts

I am creating a search for my website using FULLTEXT in sql but am having trouble with a query.  Here is the code that creates the search:

 

 

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

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

 

when ever i run this if im searching for "Jason" and type "Jason" it finds it no problem.  But say I type "Jasonb" it dosnt find "Jason".  Should the two wild cards i attach to the search variable fix that problem?  Or am i missing something else.

Link to comment
https://forums.phpfreaks.com/topic/119586-sql-query-question/
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.