The following is an example of, basically, the same piece of code 
written in three different languages. It is a query of a mysql 
datasource that then outputs the resulting recordset to the page. 
Obviously the word wrap of mail will make some things appear larger than 
they are, but......

**************
A) ColdFusion (just add datasource)
<cfquery name="qGetData" datasource="#myDSN#">
        SELECT entrytitle, entrytext,entrydate FROM weblog ORDER BY entrydate 
DESC LIMIT 10
</cfquery>
<cfoutput query="qGetDate">
        <li>#qGetData.entrytitle# (#dateformat(qGetData.entrydate, 
"mm/dd/yyyy")#): #qGetData.entrytext#</li>
</cfoutput>

*******************
B) PHP (requires the additional mysql code libraries)
<?php
    mysql_connect("server","username","password");
    mysql_select_db("dbname");
    $query ="SELECT entrytitle, entrytext,";
    $query.=" DATE_FORMAT(entrydate, '%M %d, %Y') AS date";
    $query.=" FROM weblog ORDER BY entrydate DESC LIMIT 10";
    $result=mysql_query($query);
    while (list($entrytitle,$entrytext,$entrydate) =
     mysql_fetch_row($result)) {
        echo "<dt><b>$entrytitle ($entrydate)</b></dt>";
        echo "<dd>$entrytext</dd>";
    }
  ?>

*****************
C) ASP.NET (C#)
<%@ Page Language="C#" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Odbc" %> <script runat="server">

     void Page_Load() {
        string strConnection = "Driver={MySQL ODBC 3.51 
Driver};Server=localhost;Database=test;uid=guest;pwd=pass";

          OdbcConnection objConn = new OdbcConnection(strConnection);

          OdbcCommand objCommand = new OdbcCommand("SELECT entrytitle, 
entrytext,DATE_FORMAT(entrydate, '%M %d, %Y') AS date FROM weblog ORDER 
BY entrydate DESC LIMIT 10", objConn);

          objConn.Open();

          OdbcDataReader objRdr = objCommand.ExecuteReader();

          dgbooks.DataSource = objRdr;
          dgbooks.DataBind();

          objRdr.Close();
          objConn.Close();
     }

</script>

<asp:datagrid id="dgbooks" runat="server" font-size="12" font-name="Arial"
width="700" cellpadding="5" cellspacing="2">
        <headerstyle backcolor="#000000" forecolor="#FFFFFF"/> </asp:datagrid>

*************************

This is but one example, out of many, that could be used. The more code 
to be written the longer it takes to write, the more opportunities for 
error, the longer the debugging process. CF has so many difficult (and 
easy) things built in that it seriously decreases the time necessary to 
write an application (even when written well). Add a good framework to 
the mix (when it's necessary, and if you have the know how) and it can 
take even less time.

Cutter
__________________
http://blog.cutterscrossing.com

Ali Majdzadeh wrote:
> Hi: Two days before I was talking about a project with a client. He wants a 
> portal_like website that has at least 8 seperated Auction parts and some 
> message boards and a complete Administration pannel. It has at least 18 
> dynamic parts (like; News, Job finder, Seminar Alerts ...) that the admin 
> pannel controls. Plus 5 different templates for the parts and a Logo and 
> flash intro. The price I suggested in the proforma invoice was about 3500$. 
> Is the price fair? Please send me your idea about the price of such a website.
> 
> The client asked me "why are you using Coldfusion and why don't you use 
> ASP.Net or PHP?". Can you please send me a link that compared the major 
> server side technologies that I show the client the big advantages of 
> Coldfusion compared to others.
> 
> Thanks
> Ali
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266418
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to