The following query works fine.
$getDetails = "SELECT * FROM gallery_item LIMIT 0,6";
as does this
$getDetails = "SELECT * FROM gallery_item ORDER BY gallery_id DESC";
The idea is to later adapt the script to page through a set of results.
I combined the two with this
$getDetails = "SELECT * FROM gallery_item ORDER BY gallery_id DESC LIMIT $startRow,$showmax";
where $startRow is dynamically generated and $showmax is derived from a PHP constant
define('SHOWMAX', 6);
$showmax = SHOWMAX;
but this last bit seems redundant so I was wondering how to insert a PHP constant directly into a MySQL query.
I tried a few options but none seems to work.
This post has been edited by Beavis: 30 July 2008 - 10:39 PM


Help
This topic is locked
MultiQuote









