[mapserver-users] PHP Vs. Cold Fusion...

Hankley, Chip Chip.Hankley at GASAI.Com
Mon Mar 11 17:49:24 EST 2002


Jessica,

On Win2K with PHP, there are several ways to access databases. If you wanted
to use the ODBC functionality of PHP, you would set up your databases
through windows: Start=> Settings => Control Panel => Administrative Tools
=> Data Sources (ODBC). Once a system DSN is set up, that db can be accessed
via ODBC through PHP... it's pretty simple, you just connect directly to the
DSN.

PHP also has some great tools for directly accessing some of the "major"
databases - MS SQL Server, Oracle, Informix, Sybase, as well as some of the
more popular OpenSource databases - MySQL and PostgreSQL. Again, once the db
is set up, it's pretty straightforward. For example, here's a string of code
that connects to MS SQL Server and issues a query:

  $conn_ID = mssql_connect (myDBServer, Chip, theChipster);
  mssql_select_db("MyMSSQLDB", $conn_ID));
  $q_result = mssql_query("Select * FROM myDB", $conn_ID);

$q_result is the recordset of the query and can be further manipulated to
obtain results. Note that this is pretty stripped down and doesn't include
any error trapping that one would normally include, but this would work.

I've never worked with CF, so can't draw a comparison, but I can tell you
that PHP is very easy to use, efficient, flexible and free. Did I mention
that it's free?

Chip Hankley



-----Original Message-----
From: Jessica Anderson [mailto:janderson at PacificDataServices.com]
Sent: Monday, March 11, 2002 2:44 PM
To: 'Scott Carr'
Cc: mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] PHP Vs. Cold Fusion...


Scott,

Thank you for your response.  I do have some other questions such as:

Does it run off a ODBC server?

For example for cold fusion you must map out the database through cold
fusion server in order for the code to work properly how would php work in
this sense?

I knew to mapserver and trying to figure out what approach I should use in
creating maps online.

I am currently running windows 2000 operating system.

Thanks,
Jessica

-----Original Message-----
From: Scott Carr [mailto:scottcarr at telocity.com]
Sent: Monday, March 11, 2002 10:40 AM
To: janderson at PacificDataServices.com
Subject: Re: [mapserver-users] PHP Vs. Cold Fusion...


The information for PHP is easily accessible.  PHP runs on practically
everything from Win95-WinXP, Linux, Unix, and Others.  You don't have to
purchase a runtime license.  PHP has ~1200 functions at your disposal
including the MapServer functions.

PHP is easier to use.  (Opinion big time)

Look at http://www.php.net for the full manual online in different formats.

<?php
    mysql_connect("localhost", "user", "password");
    mysql_selectdb("databasename");
    $myrows = mysql_query("SELECT * FROM users");
?>

Opens a database for use and runs a query on said database. Full code.

Do you have any other questions?

Jessica Anderson wrote:

>Could anyone explain how php would be more useful than cold fusion or the
>advantages of using php?
>
>Jessica Anderson
>Pacific Data Services
>PH. (209) 524-2479
>FAX. (209) 524-0282
>
>
>

--
Thanks

Scott Carr
OpenOffice.org
Whiteboard-Doc Maintainer
http://whiteboard.openoffice.org/doc/




More information about the mapserver-users mailing list