I have looked through many forum on this topic of search for items in a table.
I have a table name "BusinessName" which has the usual business attributes. Anyways, I have this search engine that needs to have the business name fully type for it to search. For example, I have a business name of "Target", I have to type Target or else it wouldn't find it. Meaning, Tar will not find it or any other combinations besides Target.
My code:
$query = 'SELECT client_id,business_type_id,business_name,business_address,city,state_country,zip,business_phone,business_fax,webpagelink FROM BusinessName WHERE business_name LIKE \''.$searchterm.'\' LIMIT 0, 30';
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo "<p>Number of records found: ".$num_results."</p>";
for ($i=0; $i <$num_results; $i++)
Please help. I don't want to just look for Target. I want to be able to search anything related to whatever the term is being searched for. Meaning, it doesn't need to be "Target". It could be "Walmart", "Nike", "phpbuilder", "Chocolate" etc.
I got my sql book with me "Teach Yourself SQL in 10 minutes" and it doesn't say much. Please Help. I'm losing weights staying up. 😃