I have a link (older messages) that links to:
http://www.acpchnqld.org.au/forum/forum.php?next=20
This passes a new value for the variable $next.
Does the dollar sign need to be in the query string to be valid? I thought the sign was dropped when passing values to variables in this way.
With the above link I am trying to get the forum to show older messages.
The relevant code that checks for a value for $next is below. Note that this doesn't work currently. Appreciate any suggestions.
David
function treenode($postid, $title, $poster, $posted, $children,
$expand, $depth, $expanded, $sublist)
{
$this->m_postid = $postid;
$this->m_title = $title;
$this->m_poster = $poster;
$this->m_posted = $posted;
$this->m_children =$children;
$this->m_childlist = array();
$this->m_depth = $depth;
if(($sublist||$expand) && $children)
{
$conn = db_connect();
global $next;
if(!$next){
$next=0;
}
global $rpp;
$rpp = 20; //results per page
$query = "select * from header where parent = $postid order by posted desc limit $next, $rpp";
global $result;
$result = mysql_query($query);
for ($count=0; $row = @mysql_fetch_array($result); $count++)
{
if($sublist||$expanded[ $row['postid'] ] == true)
$expand = true;
else
$expand = false;
$this->m_childlist[$count]= new treenode($row['postid'],$row['title'],
$row['poster'],$row['posted'],
$row['children'], $expand,
$depth+1, $expanded, $sublist);
}
}
}