Hello,

I’m trying to do a really simple PHP report, but I’m not able . I’m not
familiar with coding. I did it in the past, but I don’t remember it. I’m
using 2.2. I looked on the forum but there is nothing really helpful. It’s a
Pipeline report.
Those are the steps I did, so if something is not correct, let me know:
http://osgeo-org.1803224.n2.nabble.com/file/n5244035/1.jpg 
1-      I have a database (.mdb) with my pipeline information. I did an ODBC
connection.
2-      I have an sdf with my pipelines.
3-      The link between both is GDM_UPI. I guess it’s the OBJ_KEYS.
4-      I put the URL to invoke 
5-      I didn’t remember what to put in the additional parameters with the URL.
(See image)
6-      I selected the layers.
7-      I displayed the results in a new window.


That is my .php code
<html>
<head>
        <title>Pipelines report</title>
</head>
<body>
<?php

$conn=odbc_connect('SuperPipes','','');

if (!$conn)
                {exit("Connection Failed: " . $conn);}


$sql="SELECT * FROM SuperPipes_AB where GDM_UPI in(" .
stripslashes($_REQUEST["OBJ_KEYS"]) .") order by STATUS ";

$rs=odbc_exec($conn,$sql);

if (!$rs)
  {exit("No Records returned");}

echo "<table width=\"80%\"><tr bgcolor=silver>";
echo "<th>GDM_UPI</th>";
echo "<th width=50%>Address</th>";
echo "<th>STATUS</th></tr>";

while (odbc_fetch_row($rs))
{
  $GDM_UPI=odbc_result($rs,"GDM_UPI");
  $STATUS=odbc_result($rs,"STATUS");
  $OPER=odbc_result($rs,"OPER");

  echo "<tr><td>$GDM_UPI </td>";
  echo "<td>$STATUS</td>";
  echo "<td> $OPER</td></tr>";
}

odbc_close($conn);
echo "</table>";
?>

</body>
</html>

Can you please help me? I’m a bit lost…

-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/How-to-do-a-php-report-tp5244035p5244035.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to