You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees
when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.
IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.
You are not logged in.
Pages: 1
I wanted to search for only those recipes that were the martin family's comfort food based on the metaKeys so I entered this in the search box:
+martin +comfort
the results were more like a union of both terms.
Inserting a:
file_put_contents("BOB.log", print_r($sql, true));
into /recipes/classes/recipes.php I found the "+" aren't in the sql query that is built but instead:
AND MATCH(name,instructions,ingredients,submitted_by,metaDesc,metaKeys) AGAINST(' martin comfort' IN BOOLEAN MODE).
I've just started learning PHP a couple days ago and have loaded my 350+ recipes directly into the database from my PC based Mastercook XML file that I exported and transformed into INSERT statements. I must say I think you've done a bangup job on this software, some of the best I've ever installed. All this is to say it could be an issue with me but I think something is going on with constructing this query. Thanks for any help.
Offline
I must say I think you've done a bangup job on this software, some of the best I've ever installed. All this is to say it could be an issue with me but I think something is going on with constructing this query. Thanks for any help.
Thanks for your kind words. The fulltext search functions aren`t particularly reliable anyway. I just experimented with them in maian recipe. I`ll just stick with standard 'like' queries in the next version.
Looks like an error anyway with the + symbols, might be the mysql_real_escape_string function stripping them out. Feel free to have a play around with the code.
Offline
OK I tracked this down into /recipes/index.php. The urldecode removes "+" and replaces them with spaces. Using the rawurldecode does not do this, I hope it doesn't cause other problems. Your thoughts? The search now works as expected.
# original $searchKeys = urldecode(cleanData($_GET['keys']));
$searchKeys = rawurldecode(cleanData($_GET['keys'])); # my change
Offline
Yep, looks good, thanks for that.
Offline
Pages: 1