I am trying to set $nextPageID
and $nextPageTitle
with the following code. Unfortunately they are not getting set.
$pageCategoryID = 1;
$nextPageOrder = 2;
$fetchedNextPageData = mysql_query("
SELECT pageID, pageCategoryID, 'order', title
FROM pages
WHERE pageCategoryID='$pageCategoryID' AND 'order'='$nextPageOrder'
") or die(mysql_error());
while ($nextPageArray = mysql_fetch_array($fetchedNextPageData)) {
$nextPageID = $nextPageArray['pageID'];
$nextPageTitle = $nextPageArray['title'];
}
My table pages
contains a row with pageID = 2, pageCategoryID = 1, order = 2, title = Next Page, plus 4 other columns with data I don't need for this query.
This code has been simplified for testing purposes. It will be sanitized after I get it working.
Any thoughts on what I can do to get this bit of code working?