How to query using variables I'm having issues with getting results from a query. I have 2 search parameters which i have set to variables. I would like to match both of these to get results.

At the moment the query is returning zero results. I think this is because it is turning the variables into strings. Replacing the variables with hardcoded values does return results. 

{% set queryKeyword = craft.request.getParam('q') %}
{% set queryLocation = craft.request.getParam('l') %}

{%
    set entries = craft.entries.section('schools').find({
       search: 'body:queryKeyword categories:queryLocation'
    })
%}


I have tried:

{%
    set entries = craft.entries.section('schools').find({
       search: 'body:' + queryKeyword + 'categories:' + queryLocation,
    })
%}


This doesn't work. 

I'm very new to Craft CMS and am not very experienced in PHP/MySQL so any help would be greatly appreciated. Thanks!
I think you are using the wrong string concatination operator. ~ is the twig string concatination operator (vs . for php and + for javascript).

Try this:

{%
  set entries = craft.entries.section('schools').find({
   search: 'body:' ~ queryKeyword ~ ' categories:' ~ queryLocation,
  })
%}