/ Published in: SQL
Expand |
Embed | Plain Text
//creation of the INDEX: //this means that when searching the string will be looked FOR IN the the 3 FIELDS specified within the brakets. ALTER TABLE fulltext_sample ADD FULLTEXT(username,first_name,last_name) //searching: //this searches any word WHERE $mystring IS contained (that's why the *) in the 3 cols SELECT * FROM fulltext_sample WHERE MATCH(username,first_name,last_name) AGAINST('*".$mystring."*' IN BOOLEAN MODE);
You need to login to post a comment.
