The way i figured that was to look at the recordset code. This line:
$rsGroupsSearch = mysql_query($query_rsGroupsSearch, $connCvmOrg) or die(mysql_error());
executes the query. the first argument:
$query_rsGroupsSearch
is the SQL string.
In the body of the page, I added the following code:
SQL: <?php echo($query_rsGroupsSearch); ?><br />
POST: <?php var_dump($_POST); ?>
to see both the SQL being executed on the database and the contents of the form post.
the result was:
SQL: SELECT * FROM groups WHERE (Region = 2) AND ((GroupLocator LIKE '%2%'))
POST: array(4) { ["sel_region"]=> string(1) "2" ["sel_location"]=> string(1) "2" ["search"]=> string(6) "Search" ["WADbSearch1"]=> string(6) "Submit" }
I could see from this part of the SQL:
GroupLocator LIKE '%2%'
that the value being used for the GroupLocator comparison was the Group ID value, not GroupLocator value.
the string