I am writing an SQL request in PHP. the request worked fine like this:
$testQuery = "SELECT `title` FROM `bibliography` Where title LIKE '%$search%'";
I need to add a limit. If I add a LIMIT with a number it works fine:
$testQuery = "SELECT `title` FROM `bibliography` Where title LIKE '%$search%' LIMIT 5";
but if i use a define:
define( 'PAGING', 2 );
$testQuery = "SELECT `title` FROM `bibliography` Where title LIKE '%$search%' LIMIT PAGING";
it throws an error:
Undeclared variable: PAGING SQL=SELECT
title
FROMbibliography
Where title LIKE '%%' LIMIT PAGING
However in other parts of the code PAGING works fine. Why this doesn't work and how can I use a define for a limit?