Re: [PHPLIB] PHPLIB-Warning: Variable passed to reset() is not an array From: Shawn Patton (shawn <email protected>)
Date: 10/28/99

As long as release 7.0 is available for download this should be a FAQ :-)

See the mailing list archives for the answer:
http://www.progressive-comp.com/Lists/?l=phplib&r=1&w=2#phplib

Mark Walter wrote:

> Hello,
>
> PHPLIB now works nearly probperly but there is a problem with an array in the
> line 184 and 185 of table.inc
>
> When I do load showoff.php3 it shows the correct referenced ID.
> Additionally Apache gives me following error message in the active_session
> data:
>
> active_sessions data
> Only the newest ten session entries are shown:
> Warning: Variable passed to reset() is not an array or object in table.inc on line 184
> Warning: Variable passed to each() is not an array or object in table.inc on line 185
>
> Have also tried the the script from the introduction:
>
> <?php
> include("table.inc"); // requires include_path to be functioning
>
> $db = new DB_Example;
> $db->query("select * from active_sessions");
>
> $t = new Table;
> $t->heading = "on";
> $t->show_result($db);
> ?>
>
> Same thing happens. The Session are OK but there is also an error message.
>
> Warning: Variable passed to reset() is not an array or object in table.inc on
> line 184
> Warning: Variable passed to each() is not an array or object in table.inc on line 185
> 9ce3aa6133cc1086c105603843d91d4d
> Example_Session
> RXhhbXBsZV9TZXNzaW9uOiR0aGlzLT5pbiA9ICIiOyAkdGhpcy0+cHQgPSBhcnJheSgpOyAkdGhpcy0+cHRbInMiXSA9ICIxIjsgJHRoaXMtPnB0WyJhdXRoIl0gPSAiMSI7ICRHTE9CQUxTWyJzIl0gPSAiMTEiOyAkR0xPQkFMU1siYXV0aCJdID0gbmV3IEV4YW1wbGVfQXV0aDsgJEdMT0JBTFNbImF1dGgiXS0+YXV0aCA9IGFycmF5KCk7ICRHTE9CQUxTWyJhdXRoIl0tPmF1dGhbInVpZCJdID0gImZvcm0iOyAkR0xPQkFMU1siYXV0aCJdLT5hdXRoWyJ1bmFtZSJdID0gInJvb3QiOyA=
>
> This is the part of table.inc line 184 and 185
>
> ## Create regular header cells
> reset($data);
> while(list($k, $d) = each($data)) {
> $this->table_heading_cell($k, $d, $class);
> }
>
> Don't know where  <email protected> is coming from - If I knew it had tried it on my own !!!
>
> Mark
>
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.