with postgres

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jesmi
    New Member
    • Apr 2007
    • 53

    #1

    with postgres

    anybody pls help me with my coldfusion!!!

    my code for selecting records from database is:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitl ed Document</title>
    </head>

    <body>

    <cfoutput > testss </cfoutput><br />


    <cfquery name="name" datasource="ubi ll">
    Select * from name
    </cfquery>




    <CFOUTPUT QUERY="name">

    <tr>

    <td width="50%" align="center"> <input type="text" name="name" size="40" value="#name.na me#" ></td><br />

    <td width="50%" align="center"> <input type="text" name="address" size="40" value="#name.ad dress#" ></td>

    </tr>

    </CFOUTPUT>
    </body>
    </html>

    above code worked well . but when i use above code for inserting as:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitl ed Document</title>
    </head>

    <body>

    <cfoutput > testss </cfoutput><br />


    <CFOUTPUT QUERY="name">

    <tr>

    <td width="50%" align="center"> <input type="text" name="name" size="40" value="#name.na me#" ></td><br />

    <td width="50%" align="center"> <input type="text" name="address" size="40" value="#name.ad dress#" ></td>

    </tr>

    </CFOUTPUT>

    <cfquery name="name" datasource="ubi ll">
    INSERT
    INTO name
    (name,address)
    VALUES
    ('#name.name#', '#name.address# ')
    </cfquery>


    </body>
    </html>

    but this code didn't worked.what may be the right code?

    plz help me!!!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You need to put the insert code before you output the query as you have done when selecting the records.

    Comment

    Working...