Hi everyone,
I have a script that searches a MySQL db and I am having a problem.
First, the problem.... If I search the db through phpMyAdmin, all goes well. If I run rhis script, I may or may not get the results I am after. For example, I have several entries for furniture repair. If I search for furniture repair, I get no results. If I search for furniture, I get no results. If I search for repair, I also get auto repair, TV repair, etc...
I am thinking there is something wrong with the script because as I said earlier, I can search for virtually anything using phpMyAdmin and get the proper results back. So, can anyone suggest any improvements to this script or point me to a resource?
Thanks in advance,
Jim
$query = sprintf (
"SELECT `Cats`.`Name`,`Address`.`Address`,`Address`.`Ci
+ty`,`Contact`.`Phone`,`Keys`.`Keywords`
FROM
(
`Cats`
LEFT JOIN
`Address`
USING (`Name`)
LEFT JOIN
`Contact`
USING (`Name`)
LEFT JOIN
`Keys`
USING (`Name`)
)
WHERE
`Keys`.`Keywords` LIKE '%$search%'
ORDER BY name asc LIMIT %d,%d",
$start - 1, # number of records to skip
$per_page + 1);
}