[PHP] Re: Creating methods runtime

2002-02-21 Thread Matthew J Gray

No there really isn't.  I wrote an extension that does it for me, but
I am waiting to see what the second zend engine will have for this
rather that using my hack.  Maybe check the Zend Engine 2 mailing list
to see what the future may hold.

Matt

Mika Tuupola wrote:
> 
> Is there a way to create/add methods runtime to a class via
> constructor or static factory method? I know it is possible
> to create functions runtime using eval() or create_function()
> but I havent been able to make them appear as methods for
> a class.
> 
> --
> Mika Tuupola  http://www.appelsiini.net/~tuupola/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Guestbook question

2002-02-22 Thread Matthew J Gray

Take a look at mysql_data_seek()

Matt

James Taylor wrote:
> 
> I have a really simple guestbook that allows someone to post to the book,
> then it displays all the entries.  Well, there are too many entries now for
> just one page and it looks kinda wacky, so I wanted to do something where it
> only displays 10 entries per page, then there are links for pages say 11-20,
> 21-30, etc.   I have no idea how to do this - I only know how to limit the
> number of entries per page.  So, the script that displays all the entries
> looks something like this:
> 
> $counter = 0;
> $result = mysql_query("select name, post from guestbook order by id desc",
> $db);
> 
> while (($myrow = mysql_fetch_row($result)) && ($counter < 10)) {
>echo "$myrow[0]\n";
>echo "$myrow[1]\n";
>++$counter;
> }
> 
> Well, that shows only the latest 10 alright, but what if I wanted to show
> entries 11-20?  I figure I could get the number of posts through
> mysql_num_rows, I just can't piece it all together.  Any suggestions would be
> really helpful.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php