PHP Code:
$prevpagenumber=$pages[pagenumber]-1;
$nextpagenumber=$pages[pagenumber]+1;
$prevquery=$DB_site->query("SELECT pageid FROM highlightpages WHERE pagenumber=$prevpagenumber && highlightid=$pages[highlightid]");
$nextquery=$DB_site->query("SELECT pageid FROM highlightpages WHERE pagenumber=$nextpagenumber && highlightid=$pages[highlightid]");
$prevpageid=$prevquery[pageid];
$nextpageid=$nextquery[pageid];
if ($prevquery!=0) {
$prevpage = "<a href='content.php?s=&action=highlight&do=page&pageid=$prevpageid'>Previous Page</a> | ";
}
if ($nextquery!=0) {
$nextpage = "<a href='content.php?s=&action=highlight&do=page&pageid=$nextpageid'>Next Page</a>";
}
It isn't finding anything, even if something exists. Yet, it still shows the links, which are dead links at that. Help?