Re: Re: DB_Pager: throws error when you manually change the URL parameter - how can you error check?
| From: | Lorenzo Alberton | Date: | Thu, 08 Sep 2005 16:20:53 +0000 |
| Subject: | Re: Re: DB_Pager: throws error when you manually change the URL parameter - how can you error check? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20867@lists.php.net to get a copy of this message | ||
l Burnerheimerton wrote:
$data = $db_pager->getData($from, $limit, $numrows, $maxpages); if (PEAR::isError($data)) { //uh-oh... //handle error } HTH -- Lorenzo Alberton http://pear.php.net/user/quipoAny one else have any ideas that are not simply concurring there is an error? Will checking is_scalar(&_GET['from']) suffice?It looks like there's a array: data['current'] data['firspage'] data['lastpage'] data['pages'] When you change the URL parameter "from=", it throws as error: Warning: Cannot use a scalar value as an array in C:\...\page.php on line 66. My line 66 is: foreach ($data['pages'] as $page => $start_row) { What do I need to do to error check for THAT url parameter?The $data seems not to be what you should have as the return value from DB::Pager. The message cannot be more clear. --Pierre