[Mapserver-users] Please Help...Joins with MapServer PHP/Mapscript

Robert Crossley robert at wotzhere.com
Wed May 14 19:07:17 EDT 2003


Mike,

I had a similar problem with ASP linking to a SQLServer database, and ended 
up using the query template to call another page with the (C_LINKCODE) as a 
join parameter.  Code below - qryaddress is the parameter where the 
C_LINKCODE values from the map table is replaced by MapServer, and this is 
passed to another .asp page that selects from the other database to display 
the results.  You need a connection and driver to that database to make it 
work, but it is generic to any database. You could redirect it to a php 
page just as easily.

Rob.

TEMPLATE PAGE:

<!--Start of Page Body-->
<HTML>

<noscript>
<!--
    meta-tag "refresh" is provided for those browsers that
    do not support JavaScript.  Please note that the time
    delay is greater than zero.

    Notice that this is nested within a "noscript" block.
    Which means that browsers that support JavaScript will
    not "see" the refresh meta-tag.
-->
<meta http-equiv="refresh" content="1; URL=redirectiontarget.asp">
</noscript>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var now = new Date();
var timestamp = now.getHours()+'.'+now.getMinutes()+'.'+now.getSeconds();
var qryaddress = 
"../fmapwebdev/queries/QueryDisplay.asp?PadId=[C_LINKCODE]&QType=Paddock&RF=";
window.location=qryaddress + timestamp
// End -->

</script>

<noscript>
It appears that your browser does not support JavaScript, or you have it 
disabled.  This site is best viewed with JavaScript enabled.<p>If 
JavaScript is disabled in your browser, please turn it back on then reload 
this page.<p>Or, if your browser does not support JavaScript, click <a 
href="http://xxxxx/fmapweb/queries/QueryDisplay.asp">here</a>.
</noscript>

</HTML>
R

On Wed, 14 May 2003 17:44:17 -0400, Mike Leahy <mgleahy at fes.uwaterloo.ca> 
wrote:

> I´m pretty sure I sent a request for info on this question on monday, but 
> so far there has been no response...I apologize if I am unnecessarily 
> repeating this request.
>
> Essentially, I´m trying to link a DBF file to the attributes of a 
> shapefile.  So far, it seems to work (at least there are no errors when 
> the mapfile is displayed through the PHP web interface).  However, if I 
> query a location on the map from the PHP web interface, I get no results 
> for the joined table.
>
> I tried using results templates, as the documentation suggests, but that 
> had no impact.  After going through code in the PHP/PHTML scripts, it 
> seems to me that there is no function included for handling joins in the 
> PHP version.  Is this the case?  If so, how might I go about building 
> such functionality myself.  If not, perhaps someone can tell me what I 
> have missed.
>
> Using: MapServer 3.5.6 with MapLab 2, on WinXP running IIS (with all 
> updates).
>
> Thanks,
> Mike
>
> ----------------------------------------
> This mail sent through www.mywaterloo.ca
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>



-- 

Robert Crossley Robert Crossley & Assoc P/L
9 Short St
New Brighton 2483
Far Southern Queensland
AUSTRALIA

P: 02 6680 1309
F: New Connection
M: 0419 718 642
E: robert at wotzhere.com



More information about the mapserver-users mailing list