When executing a request for full-text search, an error is returned Unknown column 'search' in 'where clause', the query itself:

SELECT * FROM `sandoz` WHERE MATCH (AssetType, AssetSubtype, UniqID, Asset_Status, SN, CR_IMEI) AGAINST (". $_POST["search"] .") 

I can not find a solution to the problem

  • var_dump($sql); after this line and here is the result. - Manitikyl
  • in the AGAINST construct, the search text must be bracketed, the answer given below is madfan41k

2 answers 2

 $sql = "SELECT * FROM `sandoz` WHERE MATCH (AssetType, AssetSubtype, UniqID, Asset_Status, SN, CR_IMEI) AGAINST ('". $_POST["search"] ."')"; 
  • I corrected, I have already written the answer below)) - Elanyl

When searching, I specified non-indexable columns in a table without keys, which is why it does not search, added ALTER TABLE table indexes ADD INDEX ('Asset') and ALTER TABLE table name ENABLE KEYS entered