Cant read searched array
ZonaX
Joined: 2006-11-02
Posts: 64 |
Posted: Tue, 2007-02-13 15:33 |
Hello, i have a problem with getting data from the database, and sending it to a block. I send a array with the search data to the block. I know that the array contains some data because print_r works and shows me allot lines of info. But when i try to read a field from the array. I get the following error: Fatal error: Cannot use object of type GallerySearchResults as array in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\gallery2\g2data_gvscs8w43v\smarty\templates_c\%%1126263096\%%19^193^1939C2FA%%ShowNaam.tpl.php on line 7 Line 7 contains: Where i try to read the "fields" field from the array $block.persoonnaam.namen. I hope you guys can help me sort this out. - Jim Signature____________ |
|
Posts: 32509
you should use it as:
and $searchResultsis a GallerySearchResults object, not a row or whatever you might think.
there are plenty of examples on how to use the $searchResults object in g2.
e.g.
--------------
Enter the Gallery 2 Theme Contest today!