I have two select queries returning different results as follows:
This query returns 29 rows:
SELECT SQL_CALC_FOUND_ROWS `last`,`first`,`mate`,`address`
FROM `homeownersnew`
WHERE `last` LIKE "s%" AND
`address` != ""
LIMIT ' . (($pagination->get_page() - 1) * $records_per_page) . ', ' . $records_per_page . '';
This query uses a variable to attempt to accomplish the same results but returns 0 rows:
@$last = "s%";
SELECT SQL_CALC_FOUND_ROWS `last`,`first`,`mate`,`address`
FROM `homeownersnew`
WHERE `last` LIKE "$last" AND
`address` != ""
LIMIT ' . (($pagination->get_page() - 1) * $records_per_page) . ', ' . $records_per_page . '';
I'm sure I am overlooking something but am unable to find the problem.