pagination Object
(
[url] => http://www.box46.com/user/videos/XBP/
[username] => The Creator
[page] => 1
)
thats what i get from ur pre thing.
and as for knowing that the variables aren't sent...
i made a constructor function which just echoed the variables and it had no output...
the function that im using (although it isnt the only one) looks like this:
function query($query)
{
if($this->safety() == true){
$rows = $this->rows_per_page();
$start = ($rows * ($this->page - 1)) + 1;
$end = ($rows * $this->page);
str_replace('XBS', $start, $query);
str_replace('XBE', $end, $query);
return $query;
} else {
return 'Error';
}
}
i'll explain the idea behind it...
to call it you go like this:
$page = new pagination;
$query = mysql_query($page->query("SELECT * FROM `whatever` WHERE `something` = `thing` ORDER BY `id` LIMIT XBS, XBE"));
so the function replaces the XBS and the XBE with the relevant start and end numbers which it works out from another function.
this might not be the best way of doing this, but im just doing it from my head so don't critisize it too much please
thanks again,
The Creator
Edit
Ok, ive come alot further with this and ive changed it now. I only have one problem left! (i hope). If you look in the query function, it seems that str_replace isn't working...
why not?! haha
EDIT: oh right no variable in front... silly me
thanks again,
The Creator
Edit again
ok its all fixed, just needed an hour of debugging
thanks for the help,
The Creator
Edited by rc69, 28 March 2008 - 02:00 PM.