<html>
<body>
<tt>Thomas,<br><br>
Here's some info to hopefully help you get to drawing your points.&nbsp;
You need a &quot;dummy&quot; layer in your map file and a point symbol
(many ways to draw a symbol - I show the use of a gif file defined in the
sysmbols.list file).&nbsp; The PHP I show is excerpts from a much larger
script, so I do not guarantee it will work exactly as written, but should
give you an idea of the basics steps so you can find your way to drawing
the point layer in php mapscript.&nbsp; This is also from php mapscript
that is a couple revs back, things may have changed slightly in some of
these commands, so be sure to verify them against current php mapscript
documentation.<br><br>
hth,<br><br>
Dan<br><br>
<br>
&lt;&lt; excerpts from map file &gt;&gt;<br><br>
symbolset &quot;./symbols/symbols.list&quot;<br><br>
LAYER<br>
&nbsp; NAME 'Points'<br>
&nbsp; TYPE POINT<br>
&nbsp; STATUS ON<br>
&nbsp; CLASS<br>
&nbsp;&nbsp;&nbsp; name 'points'<br>
&nbsp;&nbsp;&nbsp; style<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYMBOL 'point'<br>
&nbsp;&nbsp;&nbsp; end<br>
&nbsp; END<br>
END<br><br>
<br>
&lt;&lt; excerpt from symbol.list file &gt;&gt;<br><br>
SYMBOL<br>
&nbsp; NAME 'point'<br>
&nbsp; TYPE PIXMAP<br>
&nbsp; IMAGE 'point.gif'<br>
END<br><br>
<br>
&lt;&lt; excerpt from php mapscript &gt;&gt;<br><br>
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
&nbsp;* Get the MAPSERVER MAP FILE and create NEW MAP OBJECT <br>
&nbsp;*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/<br>
&nbsp; $map = ms_newMapObj($mapPath.$mapFile);<br>
&nbsp; $image=$map-&gt;draw();<br>
&nbsp; $layer =&nbsp; $map-&gt;getLayerByName( &quot;Points&quot;
);<br><br>
&nbsp; $results = queryDBase( $dbaseInfo, $table, $where, $map
);<br><br>
&nbsp; // Loop through result of point query and:<br>
&nbsp; while ($line = mysql_fetch_array($results, MYSQL_ASSOC)) {<br>
&nbsp;&nbsp;&nbsp; $pt = ms_newPointObj();<br>
&nbsp;&nbsp;&nbsp; $pt-&gt;setXY( $line[&quot;longitude&quot;],
$line[&quot;latitude&quot;] );<br>
&nbsp;&nbsp;&nbsp; $pt-&gt;draw($map, $layer, $image, 0,
&quot;&quot;);<br>
&nbsp; } //end while()<br><br>
&nbsp; $layer-&gt;draw($image);<br>
&nbsp; $image_url_PNG=$image-&gt;saveWebImage();<br><br>
<br>
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
// queryDBase - query the database for point within the current
extent<br>
//<br>
// $dbaseInfo - array holding host, user, pwd, dbase, and table info for
the database query<br>
// $table - table to query for layer in database<br>
// $where - additional where clause info for the select query<br>
// $map - current map object to determine current map extents<br>
//<br>
// returns $result - the query results<br>
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
function queryDBase( $dbaseInfo, $table, $where, $map ) {<br><br>
&nbsp; $lf = &quot; \n&quot;;<br>
&nbsp; $method = &quot;[queryDBase]&quot;;<br><br>
&nbsp; // Connect to mySQL database then select the database to
use.<br>
&nbsp; $link = mysql_connect($dbaseInfo[&quot;host&quot;],
$dbaseInfo[&quot;user&quot;], $dbaseInfo[&quot;pwd&quot;] )<br>
&nbsp;&nbsp;&nbsp; or die(&quot;Could not connect to mySQL&quot;);<br>
&nbsp; mysql_select_db($dbaseInfo[&quot;dbase&quot;])<br>
&nbsp;&nbsp;&nbsp; or die(&quot;Could not select
database&quot;);<br><br>
&nbsp; // Set query string - query for points only in current
extent<br>
&nbsp; $queryStr = &quot;SELECT * FROM &quot;.$table.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; WHERE latitude &lt; &quot;.$map-&gt;extent-&gt;maxy.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; AND latitude &gt; &quot;.$map-&gt;extent-&gt;miny.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; AND longitude &lt; &quot;.$map-&gt;extent-&gt;maxx.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; AND longitude &gt; &quot;.$map-&gt;extent-&gt;minx.<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;
$where;<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>fwrite(
$file, $lf.$method.&quot;DEBUG: queryStr= &quot;.$queryStr);<br><br>
&nbsp; // perform query, then close database link<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>$result =
mysql_query($queryStr) or die(&quot;Query failed&quot;);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>$numRows =
mysql_num_rows( $result );<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>mysql_close($link);<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>return
$result;<br>
}<br><br>
<br><br>
<br>
</tt>At 03:41 AM 3/15/2005, you wrote:<br>
<blockquote type=cite class=cite cite><font face="arial" size=2>Hi
Dan,<br>
&nbsp;<br>
Firstly forgive me, I found your email in a post from 2003.&nbsp; <br>
&nbsp;<br>
Do you have any example of using PHP mapscript to retrieve a list of lat
longs from a mysql (or any) database and add as a layer to a map file
?&nbsp; My expertise is in c, .net and java, so a quick example will save
me tons of time.<br>
&nbsp;<br>
Many Thanks in advance.<br>
Thomas<br>
&nbsp;<br>
Ps<br>
This is the link I found.<br>
<a href="http://lists.gis.umn.edu/pipermail/mapserver-users/2003-April/003034.html" eudora="autourl">http://lists.gis.umn.edu/pipermail/mapserver-users/2003-April/003034.html</a></font></blockquote></body>
</html>