[Chameleon] Custom Query/PHP Help

Tim Badtke TBadtke at eastcentralrpc.org
Tue Dec 6 08:17:28 EST 2005


Thanks Mike, Joanne McGraw pointed me in the right direction. Here's the
code that works for me:

foreach( $aResults as $nLayerIdx => $aResult)
   {
       $oLayer = $oMapSession->oMap->getLayer($nLayerIdx);
       $szName = $oLayer->name;
       if( $szName == 'indx2000' )
         {
	     foreach($aResult as $aRow)
      		 {
              	     
                       echo 'Photo Number:' . $aRow['TILE_ID'] . '<br>';
                       echo 'County:' . $aRow['COUNTY'] . '<br>';
		           echo '<img src="../photos/2000/' .
$aRow['TILE_ID'] . '.jpg">';
		           
	         	 }
         }
   }

Tim

-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Mike Leahy
Sent: Monday, December 05, 2005 4:44 PM
To: chameleon at lists.maptools.org
Subject: Re: [Chameleon] Custom Query/PHP Help

Hello Tim,

Maybe you could try var_dump($aResult); in the php code - this will show
you a description of the entire array variable and its contents, which
might help you determine the source of your problem.

Mike

Tim Badtke wrote:
> I'm trying to get the custom query working for me.  I want to show a 
> photo index so the user can click a photo and see it in a pop up 
> window.  I found this thread while playing around with the Tiki custom

> query 
> http://lists.maptools.org/pipermail/chameleon/2005-January/001802.html
>
<http://lists.maptools.org/pipermail/chameleon/2005-January/001802..html
>.
> I'm having a problem displaying fields.  Here's the code:
> 
>    foreach( $aResults as $nLayerIdx => $aResult)
>    {
>        $oLayer = $oMapSession->oMap->getLayer($nLayerIdx);
>        $szName = $oLayer->name;
>        if( $szName == 'indx2000' )
>          {
>            echo 'Photo Number: ' . $aResult['TILE_ID'] . '<br>';
>            echo 'County: ' . $aResult['COUNTY'] . '<br>';
>            echo '<img src="../photos/2000/'.$aResult['TILE_ID'].'">';
>          }
>       
> The query prints out
>  
>     Photo Number:
>     County:
>    
> with no image.  I'm not very familiar with php but I know that the 
> $aResult['TILE_ID'] isn't returning anything.  If I just use $aResult 
> I get the contents of the array - all the fields in the table.  Can 
> someone point me in the right direction for returning values from the 
> fields I need?
>  
> Thank you,
> Tim
> 
> 
> ----------------------------------------------------------------------
> --
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon





More information about the Chameleon mailing list