Re: Pager not working
| From: | Lorenzo Alberton | Date: | Thu, 29 Jul 2004 08:27:29 +0000 |
| Subject: | Re: Pager not working | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13900@lists.php.net to get a copy of this message | ||
Hi,
On Wed, 28 Jul 2004 14:42:17 +0200, Boris_on_Knoppix wrote:
> I'm just starting to use PEAR. (i.e complete noobie, you'll see) I
> want to use HTML_Quickform and display the result with the Pager,
> but I just can't make it work.
>
> I use this exemple to build my pager :
>
> http://seagull.phpkitchen.com/docs/wakka.php?wakka=PagingRecordsets
>
> Pager links work fine,since I include my query (select * from
> mytable where name like Bob) in the code.
>
> Then I build a Quickform, with a field called 'name', and change
> the query of the pager into (select * from mytable where name like
> '$_Post[name]')
>
> This works fine and displays the first results, but if I click on
> the link to page2 on the pager, the '$name' value is not passed to
> the page, so the query is wrong.
Pager passes values through the GET querystring.
You're trying to fetch a value for the $_POST array.
If you want to propagate your parameter, you must
pass it via GET.
For instance, at the first script invocation, you may
store the $_POST['name'] value into $_GET['name']
or in the session, and fetch it from there on your
next invocation.
HTH
Regards,
--
Lorenzo Alberton
http://pear.php.net/user/quipo