Inserting form variables in a databse

I need to store
user entered form values in a database.
I need to delete extisiting records before loading these values
how can I do it in coldfusion7
I was examining a file it was using this
Artist_desc                  = '#FORM["Artist#'i#"]'
what does it mean

Artist_Desc is a field in a database.
A form has been submitted that has multiple fields named 'Artist' and numbered consecutively.  I.E. Artist1, Artist2, Artist3, etc.
The developer used array notation to dynamically reference these form fields with the string "Artist" and a variable 'i'.
There seems to be a syntax error in the code sample you provided, that double(") quotes, single(') quotes and hash(#) marks do not seem properly nested to me.

Similar Messages

  • Joining form variables for an insert

    I have two form variables #Select# and #masterno1# that I
    want to
    insert into a single database column with a trailing ".jpg".
    What is the correct syntax? I dont have much idea how cold
    fusion wants this
    variable so it dosent throw an error
    Here the value of my insert query. Thanks in advance
    <cfqueryparam value='evaluate(#Select##masterno1#".jpg")'
    cfsqltype="cf_sql_varchar" maxlength="255">,

    Perhaps I'm missing something, but haven't you
    overcomplicated things?
    How about
    <cfset newvalue="#Select##masterno1#.jpg">
    <cfquery name="myquery" datasource="mydsn">
    insert into MY_TABLE
    (my_column)
    values ('#newvalue#')
    </cfquery>
    ???

  • Trying to move a list of form variables to session variables of the same name

    I am trying to move a list of form variables to session variables of the same name and I am having a lot of trouble.
    I have never had to post of this forum with a language question in all the 10 years I have been using ColdFusion. I was a qa Engineer @ Allaire/Macromedia back when it was going from one to the other. I have a pretty good grasp of the language.
    I have software that runs off a list. The fieldnames are variable and stored off in an array. It's survey software that runs off a "meta file". In this example; I have the number of fields in the survey set to 12 in the "metafile". I have each field declared in that file in array Session.SurveyField[1] and the above loop works fine. I include this "metafile" at the start of the process.
    I cfloop around a struct and it works wherever I have needed to use it; such as here - writing to the database for example;
    <CFQUERY NAME="InsertRec" DATASOURCE="Survey">
    INSERT into #variables.SurveyTableName#
    (EntryTime
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    ,#Session.SurveyField[arrayindex]#
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,q01_name,q02_AcadTechORNA,q03_Water,q04_FirstAid,q05_CPR,q06_LifeGuard,q07_AED
    ,q08_ProjAdv,q09_Color,q10_SantaClaus,q11_Supervisor,q12_SupervisorOpinion --->
       VALUES
        ('#EntryTime#'
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thisname = "Session." & Session.SurveyField[arrayindex]>
    ,'#evaluate(variables.thisname)#'
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,'#Session.q01_name#','#Session.q02_AcadTechORNA#','#Session.q03_Water#','#Session.q04_Fi rstAid#'
    ,'#Session.q05_CPR#','#Session.q06_LifeGuard#','#Session.q07_AED#','#Session.q08_ProjAdv# ',
    ,'#Session.q09_Color#','#Session.q10_SantaClaus#','#Session.q11_Supervisor#','#Session.q1 2_SupervisorOpinion#' --->
    </CFQUERY>
    NOW HERE'S THE PROBLEM: I am running into trouble when trying to move the form variables to session variables of the same name. It is the only part of the software that I still need the datanames hard coded and that is a roadblock for me.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thissessionfield = "Session." & Session.SurveyField[arrayindex]>
    <cfset thisformfield = "Form." & Session.SurveyField[arrayindex]>
    <cfset #thissessionfield# = #evaluate(thisformfield)#>
    </cfloop>
    I have tried it with or without the "evaluate"; same result. It doesn't give an error; it just ignores them (session variables look as such in the next page in the chain)
    q01_name=
    q02_acadtechorna=
    q03_water=
    q04_firstaid=
    q05_cpr=
    q06_lifeguard=
    q07_aed=
    q08_projadv=
    q09_color=
    q10_santaclaus=
    q11_supervisor=
    q12_supervisoropinion=
    Note: they exist because I CFPARAM them in a loop like the above at the start of the procedure) - and this works just fine!
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset dataname = "Session." & Session.SurveyField[arrayindex]>
    <cfparam name="#variables.dataname#" default="">
    </cfloop>
    </cflock>
    I EVEN tried exploiting the Form.Fieldnames list using CFLoop over the list and the same sort of logic within and it still gives me nothing....
    Here's the FORM.FIELDNAMES value
    "Q01_NAME,Q02_ACADTECHORNA,Q03_WATER,Q04_FIRSTAID,Q05_CPR,Q06_LIFEGUARD,Q07_AED,Q08_PROJAD V,Q09_COLOR,
    Q10_SANTACLAUS,Q11_SUPERVISOR,Q12_SUPERVISOROPINION"
    Here's the logic; SAME RESULT - The session variables don't get set.
    <cfoutput>
    <cfloop list="#Form.FieldNames#" index="thisfield">
    <!--- <br>#thisfield# --->
    <cfscript>
    thisSESSIONfield = "Session." & thisfield;
    thisFORMfield = "Form." & thisfield;
    #thisSESSIONfield# = #thisFORMfield#;
    </cfscript>
    </cfloop>
    </cfoutput>
    The CFPARAM in a loop with variable output name works just fine; so does the post (which I included above) as does the SQL Create, Param Form Variables, Param Session Variables, etc.
    THIS even works for moving BLANK to each session variable, to zero them all out at the end of the process;
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    </cfscript>
    <cfset #thissessionfield# = "">
    </cfloop>
    </cflock>
    Expanding on that code, you would think this would work, but it doesn't;
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    thisformfield = "Form." & thislocalfield;
    </cfscript>
    <!--- debug --->
    <!--- <cfoutput>#thissessionfield# = "#evaluate(thisformfield)#"</cfoutput><br> --->
    <cfoutput>
    <cfset #thissessionfield# = "#evaluate(thisformfield)#">
    </cfoutput>
    </cfloop>
    And see that debug code in the middle? To add insult to injury... When I uncomment that it shows me this. So it certainly looks like this should work....
    Session.q01_name = "Me"
    Session.q02_AcadTechORNA = "N/A"
    Session.q03_Water = "Yes (certificate expired)"
    Session.q04_FirstAid = "Yes (certificate is current)"
    Session.q05_CPR = "No"
    Session.q06_LifeGuard = "Yes (certificate expired)"
    Session.q07_AED = "Yes (certificate expired)"
    Session.q08_ProjAdv = "Yes (certificate expired)"
    Session.q09_Color = "Gray"
    Session.q10_SantaClaus = "Yes"
    Session.q11_Supervisor = "Da Boss"
    Session.q12_SupervisorOpinion = "Not a bad thing"
    There must be some simpler way to do this. This way won't work against all odds even though it seems so much like it should.
    So I end up having to hardcode it; still looking for an automated way to set these #@%$*@!## session variables over the list from the form variables of the same @#@!$#%$%# name. Do I sound frustrated???
    No matter what I do, if I don't HARDCODE like this;
    <cfset Session.q01_name = Form.q01_name>
    <cfset Session.q02_AcadTechORNA = Form.q02_AcadTechORNA>
    <cfset Session.q03_Water = Form.q03_Water>
    <cfset Session.q04_FirstAid = Form.q04_FirstAid>
    <cfset Session.q05_CPR = Form.q05_CPR>
    <cfset Session.q06_LifeGuard = Form.q06_LifeGuard>
    <cfset Session.q07_AED = Form.q07_AED>
    <cfset Session.q08_ProjAdv = Form.q08_ProjAdv>
    <cfset Session.q09_Color = Form.q09_Color>
    <cfset Session.q10_SantaClaus = Form.q10_SantaClaus>
    <cfset Session.q11_Supervisor = Form.q11_Supervisor>
    <cfset Session.q12_SupervisorOpinion = Form.q12_SupervisorOpinion>
    I always get this from my next page because the session variables are empty;
    You must answer question 1.
    You must answer question 2.
    You must answer question 3.
    You must answer question 4.
    You must answer question 5.
    You must answer question 6.
    You must answer question 7.
    You must answer question 8.
    You must answer question 9.
    You must answer question 10.
    I tried duplicate as well, but I can not get the above to work...
    Can anyone help me do this thing that one would think is simple????

    I think if you use structure array syntax you should get the results you want.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
          <cfset session[Session.SurveyField[arrayindex]] = Form[Session.SurveyField[arrayindex]]>
    </cfloop>
    Or probably even easier.
    <cfset session = duplicate(form)>

  • How can i insert the variable value in MS ACCES Query

    i am creating one Query (query1) in MS ACCESS ( like we creaate Tables, Forms and Reports in MS ACCESS ) in this Query i have given 2 constent value in BETWEEN CLAUSE , after that i Created a CROSS QUERY which is based on the privious Query (query1).
    Now i want to insert the variable value using JSP and HTML in to Query(query1).
    Doing this i want to execute the Query (query1) with variable perameters and
    wants to get the risponce form CROSS QUERY.
    In this matter how can i insert the value in Query(query1) using JDBC and JSP.

    The query is
    Select ZMSGMAP.GROUP_CODE as 'group', ZMSDSTATE.STATE_DESC as 'state', ZMSTRN.YRMON, sum(ZMSTRN.CMAQTY) as 'qty' from ZMSDSTATE,ZMSGMAP,ZMSTRN Where ZMSTRN.STATE=ZMSDSTATE.STATE and ZMSTRN.PLANT=ZMSGMAP.PLANT_CODE and ZMSTRN.YRMON between "+p1+" and "+p2+" Group by ZMDGMAP.GROUP_CODE, ZMSDSTATE.STSTE_DESC, ZMSTRN.YRMONUsing this query i m trying to display the risult but the YRMON is displaying in a single column, i want to display it ia seperat columns. here p1 and p2 is YRMON(it is the yer month like 200102), for this solution i have created Cross table Query which is based on uper Query (query1) and design it column wise Display, it is givng the right display, but the problem is this i m not getting the technique throw which i can insert the variable values in to the query1 (which is designed in MS ACCESS).
    u can contact me on [email protected] for more details.

  • CF Set form.variable for query and Next/Previous pages error

    I have a CF form with a select that posts to a CF "action" page.
    On the action page I: CFSET ItemNumber=#form.ItemNumber#
    I CFOUTPUT the 'ItemNumber' into the CFQUERY (which is an Inner Join dependant on the '#ItemNumber#')...
    All of the above works just fine and displays the database fields in color alternating rows, per the rest of the code.
    Here's the problem:
    I'm displaying 40 rows on a page per "Next and Previous" code. (CFPARAM name="start" default="1" and CFPARAM name="disp" default="40" along with the rest of the NextN code in the header and body). This does display 40 rows on the page and puts a link at the bottom of the page "Next 40 Rows", etc.
    Note: I'm only querying the database once and using the query (query name="data") to populate the table rows And the NextN code (CFOUTPUT name="data") And (CFIF start + disp GREATER THAN data.RecordCount, etc)...
    The problem happens when you click the "Next 40 Rows" link to display the 2nd page of rows. Since (I'm assuming) this NextN code is 're-reading' the same page from top to bottom, an error is thrown when the code tries to read the CFSET ItemNumber=#form.ItemNumber# at the top of the page.
    With the #form.ItemNumber# on this action page Originally coming from the previous posting of the form to this action page, when the "Next 40 Rows" link is clicked and the NextN code re-reads this action page - the CFSET ItemNumber (#form.ItemNumber) is not getting populated and throws the error...
    I hope I've not made this sound confusing.
    I can get the NextN code to work when I'm just querying the database without "flying in" a form variable. But when I CFSET a variable (#form.ItemNumber#) that is inserted into the query, the second page of the NextN throws an error and doesn't display.
    I would include the page code here but it would be fairly lengthy and, as well, the NextN code is a 'standard' CF code -- I've narrowed the problem down to the above "Element is undefined" (when the page tries to reload from the "Next 40 Rows" link) and am hoping there's a simple fix or another way to display the records in Next and Previous pages.
    Thanks to anyone in advance for shedding light on this.
    - e

    Thank you for the reply, Owain.
    Yes - The Next/Previous at the bottom of the page are hyperlinks.
    <a href="ThisPage.cfm?start=#Evaluate("start + disp")#">
    The following is at the top of the page (and is the variable from the form that I CFOUTPUT in the query):
    <cfparam name="ItemNumberDropdown01" default="">
    <cfset ItemNumber = #form.ItemNumberDropdown01#>
    The error report showed that the "Next Page" hyperlink was reading an undefined variable... although when the "action page" first opens from the form posting to it, it populates the CFSET just fine (per the cfparam and cfset above)... As you mention, the hyperlink clearing the form scope is what causes the error in trying to display the next set of records...
    The form page and the 'action page' are both secure pages with an application page setting the session, etc. Am I at risk in using an URL scope?
    Where would this URL scope be put? (The href is shown above - would the URL scope go in this? - How would this be written?)
    The CFPARAM and CFSET would still exist at the top of the 'action page' and still throw an error wouldn't it or would this be replaced with something else to read the form.variable for this 'first' action page to be displayed?
    Thanks again for the 'education' on this...
    - ed

  • [php+mysql] how to pass data from one insert form to another?

    Hi all,
    I have an insert form (in a mysql db) on the page. Is there a way to
    view the inserted data after inserting so stat the user can print it
    out?
    TIA
    tony

    >Hi Tony,
    >let´s assume the table´s Primary Key column is named "id" -- just add this value (available as "Dynamic Data") to the "Redirect after Insert" URL in the following way:
    >print.php?id={id}
    >...and on that page add a recordset which queries the table like that:
    >"SELECT * FROM tablename WHERE id" equals the URL parameter "id"
    >That should be all there is to do.
    >Cheers,
    >Günter Schenk
    >Adobe Community Expert, Dreamweaver
    Hi Günter,
    Thanks, it works.
    I added a bit of code to set a session variable using this Parameter
    URL, so that I can manage the record ID along the whole user session.
    So, I ask you a little question: when it is best to delete or destroy
    session variables? after displaying the inserted records or just befor
    inserting the first one?
    Here is my little test workflow:
    1- destroy variable sessions (I think I will unset session variables
    one by one instead, to eliminate the risk to delete other sesssion
    variable (UserID...)
    2- insert the first record (redirect to the next page using the record
    ID1)
    3- set a session variable (S1) using the ID1 coming from previous page
    ($_GET)
    4- insert the second record (redirect to the next page using the
    record ID2)
    5- set a session variable (S2) using the ID2 coming from previous
    page ($_GET)
    6- insert the third record (redirect to the next page using the
    record ID3)
    7- set a session variable (S3) using the ID3 coming from previous page
    ($_GET)
    8- create a recordsets to filter the db by S1, S2 and S3.
    9- display the report
    it seems to work.
    do you think there is something to refine?
    Thanks again for your kindness.
    tony

  • Want to pass Applet form variables without showing it on URL Location

    I am running one applet with some form variables. After submit I want to pass those to .asp file to store into database.
    If I use URL method then all are getting displayed on URL location of browser which I do not want. I want to pass many form variables to another .asp file, so it may not be good also.
    What is the best way of doing it ? Need urgent help about it.

    I tried following code using URL Connection Object, Code is running fine in IE and Appletviewer, but not running in Netscape.
    Following is the code:
    There is an applet with form. After Submit button, The form variables will be send to ASP script where I am storing it into database. In Netscape the server connection is made (blank record is getting created) but data is not passed.
    public void actionPerformed(ActionEvent event) {
    try{
    ByteArrayOutputStream byteStream = new ByteArrayOutputStream(512);
    PrintWriter out = new PrintWriter(byteStream, true);
    String postData = "firstName=manisha";
    out.print(postData);
    out.flush();
    URL dataURL = new URL("http://manisha/appletexamples/confirm-px.asp");
    URLConnection connection = dataURL.openConnection();
    connection.setUseCaches(false);
    connection.setDoOutput(true);
    String lengthString = String.valueOf(byteStream.size());
    connection.setRequestProperty ("Content-Length", lengthString);
    connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    byteStream.writeTo(connection.getOutputStream());
    BufferedReader in =
    new BufferedReader(new InputStreamReader(connection.getInputStream()));
    String line;
    while((line = in.readLine()) != null) {
    System.out.println("line: " + line);
         } //while
         in.close();
    } //try
    catch(Exception e){}//catch
    }//action performed
    My ASP Code
    <%
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.Open("DATABASE=phptestdb;DSN=phptestdsn")
    %>
    <HTML>
    <HEAD>
    <TITLE> A Sample Program </TITLE>
    </HEAD>
    <BODY>
    <%DIM fname
    fname = ""
    fname = Request("firstName")
    response.write ("fname : " & fname)
    qrystr1 = "insert into applettesttable (fname) values ('" & fname & "')"
    conn.Execute qrystr1
    conn.Close
    Set conn = Nothing
    %>
    </BODY>
    </HTML>

  • Passing form variables

    HI~
    I have a cfform on my index.cfm page, and the action is set
    to go to a confirm.cfm page. On that page, I want the user to be
    able to look at the information they entered into the form, and
    then hit "Submit" if it is correct. Right now, I am able to display
    the form information on the confirm.cfm page, but I'm having a hard
    time with my insert statement. Right now, when I hit the final
    Submit button, an entry is made in the database, but none of the
    variables are passed. I'm guessing this is because of the cfparam
    default="" setting, but I don't know what else to set it as-- if I
    try to set it as semester or form.semester, it says it is not
    defined. Please help! Thanks!

    semi star gazer wrote:
    > OK, I think I'm still missing something here. This is
    what I have right now.
    > With this code, I get a blank entry in the database when
    the user hits the
    > Submit button.
    >
    > <cfparam name="form.semester" default="">
    >
    > <cfif isDefined("form.submitEval")>
    >
    > <!--- insert form data into database --->
    > <cfquery name="insertEval" datasource="intern">
    > INSERT INTO mentorEvals (
    > semester
    > ) VALUES (
    > '#Trim(form.semester)#'
    > )
    > </cfquery>
    >
    > <cfform action="#CGI.SCRIPT_NAME#" name="submitEval"
    METHOD="post">
    > <cfinput type="hidden" name="semester"
    value="form.semester">
    > <!--- Submit Button that reads "Submit Evaluation"
    --->
    > <cfinput type="submit" value="Submit Evaluation"
    name="submitEval"
    > id="submitEval">
    > </cfform>
    >
    try using <input type="hidden" ...> instead of
    <cfinput ...> - i seem to
    recall there being issues with hidden cfinput fields...
    also - where's your closing </cfif>??? it should be
    after </cfquery> - i
    hope it is actually there...
    just to make sure semester is passed from first form, you can
    put
    <cfoutput>#form.semester#</cfoutput> right after
    your <cfparam>
    NOTE: you do not really need that <cfparam> there... it
    does not do
    anything... unless you are planning to use it later for
    validation
    routines... i wonder if it may be tampering with the semester
    value...
    it shouldn't, but who knows...
    Azadi Saryev
    Sabai-dee.com
    Vientiane, Laos
    http://www.sabai-dee.com

  • Lightwindow passing form variable to action page

    Hi,
    I have a form that is popup using lightwindow to allow users to fill out the form.  For some reason, I couldn't get the form.variables to pass to the action page and insert into a database.  Anyone has suggestions or ideas?
    thanks.

    link to open lightwindow pop up page.  of course i've all the js required on the top of the page
    <a href="form.cfm" params="lightwindow_width=500,lightwindow_height=600" class="lightwindow page-options">Form</a>
    here is the form
    <form id="form1" name="form1" method="post">
    <p><label for="fname">First Name</label><input type="text" name="fname" id="fname" class="inputText" /></p>
    <p><label for="lname">LastName</label><input type="text" name="lname" id="lname" class="inputText" /></p>
    <p><p><a href="hello.cfm" params="lightwindow_form=form1" class="lightwindow_action" rel="submitForm"><button>Submit</button></a> or <a href="#" class="lightwindow_action" style="color: blue;" rel="deactivate">Cancel</a>
    </p>
    here is the action page for the form (hello.cfm)
    <cfoutput>#form.fname# | #form.lname#</cfoutput>
    I do not know if this is out it's supposed to do it or not but the form variables are not passing over to the action page.
    thanks

  • I WANT THE RESULT PAGE OF MY INSERT FORM TO BE AN UPDATE FORM OF THE JUST INSERTED DATA

    I WANT THE RESULT PAGE OF MY INSERT FORM TO BE AN UPDATE FORM OF THE JUST INSERTED DATA USING ADDT. PLS HELP WITH EXMPLE . THANKS

    let me xplain
    i am trying to create a 3  page form. i used the insert form wizard to create the first form and ask the form to go to the next page which i made an update form to continue the next set of fields. i tried what u said...but the next form did not add records to the database as i expected.below is my code for the two pages. pls tell me the best approach..thanks
    page 1
    <?php require_once('Connections/crusader.php'); ?>
    <?php
    //MX Widgets3 include
    require_once('includes/wdg/WDG.php');
    // Load the common classes
    require_once('includes/common/KT_common.php');
    // Load the tNG classes
    require_once('includes/tng/tNG.inc.php');
    // Make a transaction dispatcher instance
    $tNGs = new tNG_dispatcher("");
    // Make unified connection variable
    $conn_crusader = new KT_connection($crusader, $database_crusader);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $tNGs->prepareValidation($formValidation);
    // End trigger
    // Make an insert transaction instance
    $ins_capital = new tNG_insert($conn_crusader);
    $tNGs->addTransaction($ins_capital);
    // Register triggers
    $ins_capital->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
    $ins_capital->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    $ins_capital->registerTrigger("END", "Trigger_Default_Redirect", 99, "top.php");
    // Add columns
    $ins_capital->setTable("capital");
    $ins_capital->addColumn("cap_firstname", "STRING_TYPE", "POST", "cap_firstname");
    $ins_capital->addColumn("cap_username", "STRING_TYPE", "POST", "cap_username");
    $ins_capital->addColumn("cap_lastname", "STRING_TYPE", "POST", "cap_lastname");
    $ins_capital->addColumn("cap_dateofbirth", "DATE_TYPE", "POST", "cap_dateofbirth", "{NOW}");
    $ins_capital->addColumn("cap_sex", "STRING_TYPE", "POST", "cap_sex");
    $ins_capital->setPrimaryKey("cap_id", "NUMERIC_TYPE");
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rscapital = $tNGs->getRecordset("capital");
    $row_rscapital = mysql_fetch_assoc($rscapital);
    $totalRows_rscapital = mysql_num_rows($rscapital);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <?php echo $tNGs->displayValidationRules();?>
    <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>
    <script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script>
    <script src="includes/resources/calendar.js"></script>
    </head>
    <body>
    <p> 
      <?php
        echo $tNGs->getErrorMsg();
    ?>
    <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
      <table cellpadding="2" cellspacing="0" class="KT_tngtable">
        <tr>
          <td class="KT_th"><label for="cap_firstname">Cap_firstname:</label></td>
          <td><input type="text" name="cap_firstname" id="cap_firstname" value="<?php echo KT_escapeAttribute($row_rscapital['cap_firstname']); ?>" size="32" />
            <?php echo $tNGs->displayFieldHint("cap_firstname");?> <?php echo $tNGs->displayFieldError("capital", "cap_firstname"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_lastname">Cap_lastname:</label></td>
          <td><input type="text" name="cap_lastname" id="cap_lastname" value="<?php echo KT_escapeAttribute($row_rscapital['cap_lastname']); ?>" size="32" />
            <?php echo $tNGs->displayFieldHint("cap_lastname");?> <?php echo $tNGs->displayFieldError("capital", "cap_lastname"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_dateofbirth">Cap_dateofbirth:</label></td>
          <td><input name="cap_dateofbirth" id="cap_dateofbirth" value="<?php echo KT_formatDate($row_rscapital['cap_dateofbirth']); ?>" size="32" wdg:mondayfirst="false" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="no" />
            <?php echo $tNGs->displayFieldHint("cap_dateofbirth");?> <?php echo $tNGs->displayFieldError("capital", "cap_dateofbirth"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_sex">Cap:</label></td>
          <td><input type="text" name="cap_sex" id="cap_sex" value="<?php echo KT_escapeAttribute($row_rscapital['cap_sex']); ?>" size="32" />
            <?php echo $tNGs->displayFieldHint("cap_sex");?> <?php echo $tNGs->displayFieldError("capital", "cap_sex"); ?></td>
        </tr>
        <tr class="KT_buttons">
          <td colspan="2"><input type="submit" name="KT_Insert1" id="KT_Insert1" value="Insert record" /></td>
        </tr>
      </table>
    </form>
    <p> </p>
    </p>
    </body>
    </html>
    Page2
    <?php require_once('Connections/crusader.php'); ?>
    <?php
    // Load the common classes
    require_once('includes/common/KT_common.php');
    // Load the tNG classes
    require_once('includes/tng/tNG.inc.php');
    // Make a transaction dispatcher instance
    $tNGs = new tNG_dispatcher("");
    // Make unified connection variable
    $conn_crusader = new KT_connection($crusader, $database_crusader);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $tNGs->prepareValidation($formValidation);
    // End trigger
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_crusader, $crusader);
    $query_rdd = "SELECT * FROM capital ORDER BY cap_id DESC LIMIT 1";
    $rdd = mysql_query($query_rdd, $crusader) or die(mysql_error());
    $row_rdd = mysql_fetch_assoc($rdd);
    $totalRows_rdd = mysql_num_rows($rdd);
    // Make an update transaction instance
    $upd_capital = new tNG_update($conn_crusader);
    $tNGs->addTransaction($upd_capital);
    // Register triggers
    $upd_capital->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
    $upd_capital->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    // Add columns
    $upd_capital->setTable("capital");
    $upd_capital->addColumn("cap_firstname", "STRING_TYPE", "POST", "cap_firstname");
    $upd_capital->addColumn("cap_dateofbirth", "DATE_TYPE", "POST", "cap_dateofbirth");
    $upd_capital->addColumn("cap_mobilephone", "STRING_TYPE", "POST", "cap_mobilephone");
    $upd_capital->addColumn("cap_occupation", "STRING_TYPE", "POST", "cap_occupation");
    $upd_capital->addColumn("cap_sumassured", "STRING_TYPE", "POST", "cap_sumassured");
    $upd_capital->setPrimaryKey("cap_id", "NUMERIC_TYPE", "GET", "cap_id");
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rscapital = $tNGs->getRecordset("capital");
    $row_rscapital = mysql_fetch_assoc($rscapital);
    $totalRows_rscapital = mysql_num_rows($rscapital);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <?php echo $tNGs->displayValidationRules();?>
    </head>
    <body>
    <p> 
    <p> 
      <?php
        echo $tNGs->getErrorMsg();
    ?>
    <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
      <table cellpadding="2" cellspacing="0" class="KT_tngtable">
        <tr>
          <td class="KT_th"><label for="cap_firstname">Cap_firstname:</label></td>
          <td><input type="text" name="cap_firstname" id="cap_firstname" value="<?php echo KT_escapeAttribute($row_rdd['cap_firstname']); ?>" size="32" />
            <?php echo $tNGs->displayFieldHint("cap_firstname");?> <?php echo $tNGs->displayFieldError("capital", "cap_firstname"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_dateofbirth">Cap_dateofbirth:</label></td>
          <td><input type="text" name="cap_dateofbirth" id="cap_dateofbirth" value="<?php echo KT_formatDate($row_rdd['cap_dateofbirth']); ?>" size="32" />
          <?php echo $tNGs->displayFieldHint("cap_dateofbirth");?> <?php echo $tNGs->displayFieldError("capital", "cap_dateofbirth"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_mobilephone">Cap_mobilephone:</label></td>
          <td><input type="text" name="cap_mobilephone" id="cap_mobilephone" value="<?php echo KT_escapeAttribute($row_rdd['cap_mobilephone']); ?>" size="32" />
          <?php echo $tNGs->displayFieldHint("cap_mobilephone");?> <?php echo $tNGs->displayFieldError("capital", "cap_mobilephone"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_occupation">Cap_occupation:</label></td>
          <td><input type="text" name="cap_occupation" id="cap_occupation" value="<?php echo KT_escapeAttribute($row_rdd['cap_occupation']); ?>" size="32" />
          <?php echo $tNGs->displayFieldHint("cap_occupation");?> <?php echo $tNGs->displayFieldError("capital", "cap_occupation"); ?></td>
        </tr>
        <tr>
          <td class="KT_th"><label for="cap_sumassured">Cap_sumassured:</label></td>
          <td><input type="text" name="cap_sumassured" id="cap_sumassured" value="<?php echo KT_escapeAttribute($row_rdd['cap_sumassured']); ?>" size="32" />
          <?php echo $tNGs->displayFieldHint("cap_sumassured");?> <?php echo $tNGs->displayFieldError("capital", "cap_sumassured"); ?></td>
        </tr>
        <tr class="KT_buttons">
          <td colspan="2"><input type="submit" name="KT_Update1" id="KT_Update1" value="Update record" /></td>
        </tr>
      </table>
    </form>
    <p> </p>
    </p>
    </p>
    </body>
    </html>
    <?php
    mysql_free_result($rdd);
    ?>

  • How can we use  form variable in where clause while personalization

    Dear,
    I have a requirment for using select in personalization, actully we have created temporary table, now we want to get data from select satatement on event"when-new-record-instance' trigger, now in action tab i have selected action which is property and message, in message column showing value "${item.q_res.transaction_id.value}" it shows on validate button but when this form variable use in action type(property) which is consist on select statement "=SELECT to_char(QTY) FROM TEST_TABLE where transaction_id = ${item.q_res.transaction_id.value}" system didn't get value pressing validate button although there is a single record in customize table while without where cluase was getting data perfectly.
    please advice.

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • Dreamweaver CS4 - Record Insertion Form js error

    Hi
    I'm dreamweaver cs4 and started using the Record Insertion form, I was mainly experimenting with it and just seeing what it could do.
    However when I get to the wizard i have to wait a few seconds for it to connect to the database and then I get an error message that says:
    While executing onLoad in ServerObject-InsRecPHP.htm, the following Javascript error(s) occured:
    At line 283 of the file "Macintosh HD:Application:Adobe Dreamweaver
    CS4:Configuration:Commands:ServerObject-FormCmnPHP.js":
    invalid array length
    I was just wondering if this was a common problem, or I've messed something up either in Dreamweaver, or in the SQL database that I'm using.
    I've also noticed that its the same for Update and Delete Records Wizards aswell.
    Any help would be greatly appreciated
    Aaron Kennedy

    I see it's your first post. Welcome to the forum.
    A good place to start looking for answers is the Dreamweaver FAQ. You'll find the answer to your question under "Crashes, installation, JavaScript, and unexplained problems".

  • Add a new column to an "Insert Form" created by HTMLDB Wizard throws Error

    Hi,
    My table design has changed and I had to add 2 new columns.
    The corresponding Insert Form/Report/Update Forms created by the HTMLDB should now reflect the new columns that have been added.
    In report and update forms I did not have a problem but in the Insert form, under Edit Page Process I tried to change the sql and I get the below error
    "Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with "
    My Edit Page Process SQL is as below-(Last two columns are the NEW columns i.e CDPL and CDPLCA)
    insert into "L2ENTRIES"
    ("AUTONUML2E",
    "ROLLNO",
    "AWARDCODE",
    "ROLLCLASSCODE",
    "SURNAME",
    "FORENAME",
    "SEX",
    "DOB",
    "PPSNO",
    "M1",
    "M2",
    "M3",
    "M4",
    "M5",
    "M6",
    "M7",
    "M8",
    "M9",
    "M10",
    "M11",
    "M12",
    "M13",
    "M14",
    "M15",
    "M16",
    "FEES",
    "CNULLS",
    "CDUPPPS",
    "CROLL",
    "CAWARDS",
    "CMODULES",
    "CHECKCHAR",
    "CHECKNO",
    "VALIDPPS",
    "VALIDPPSUK",
    "PPSNOPAD",
    "CDPL",
    "CDPLCA")
    values (
    :P3_AUTONUML2E,
    :P3_ROLLNO,
    :P3_AWARDCODE,
    :P3_ROLLCLASSCODE,
    :P3_SURNAME,
    :P3_FORENAME,
    :P3_SEX,
    :P3_DOB,
    :P3_PPSNO,
    :P3_M1,
    :P3_M2,
    :P3_M3,
    :P3_M4,
    :P3_M5,
    :P3_M6,
    :P3_M7,
    :P3_M8,
    :P3_M9,
    :P3_M10,
    :P3_M11,
    :P3_M12,
    :P3_M13,
    :P3_M14,
    :P3_M15,
    :P3_M16,
    :P3_FEES,
    :P3_CNULLS,
    :P3_CDUPPPS,
    :P3_CROLL,
    :P3_CAWARDS,
    :P3_CMODULES,
    :P3_CHECKCHAR,
    :P3_CHECKNO,
    :P3_VALIDPPS,
    :P3_VALIDPPSUK,
    :P3_PPSNOPAD,
    :P3_CDPL,
    :P3_CDPLCA)
    It will be great if some one can assist me in this matter.
    Thanks.

    Resolved this by a simple ";" at the end of the insert sql.
    I did not think a ";" will be necessary because when you edit the page process a ";" is not visible.

  • No longer able to insert forms without table for layout

    So I just tried for the first time since upgrading to CS6 Dreamweaver to insert a form on a page.
    Previously you were able to insert in DW and it would use DIVS for items. Now however it appears the only option anywhere is to insert form as a table.
    Chat support just confirmed this.
    If true this is a massive step backwards. I'm hoping chat was wrong and I'm just missing something because the extra work involved in removing the tables manually and recoding forms to divs is crazy.
    Please tell me I'm wrong???

    Yeah but I have to manually change it now. Before I could insert in DW as divs.
    We spend enough time wrestling other stuff in to submission - I could do without this now as well.

  • How do I pass a username form variable from a drop down list/menu to another page?

    Hi,
    I have a login_success.php page that has a drop down list/menu (which lists usernames). I want the user to click on their user name, and when they click the submit button the username information to be passed over to the username.php page which will contain a recordset, sorted by username.
    How do I pass the username info from the drop down list/menu to the username.php page?
    The drop down menu is connected to a recordset listUsername, I have filtered the recordset with the Form Variable = username, and I have used the POST method to send the username to the page username.php. I'm not sure how to structure the php or which page to place it on.
    <form id="form1" name="form1 method="post" action="username.php">
         <label for="username_id">choose username:</label>
         <select name="username_id" id-"username_id">
              <option value="1">username1</option>
              <option value="2">username2</option>
              <option value="3">username3</option>
              <option value="4">username4</option>
         </select>
         <input type="submit" name="send" id="send" value="Submit" />
         <input type="username" type="hidden" id="username" value="<?php echo $row_listUsername['username']; ?>" />
    </form>
    Could somebody help me please?
    Thanks.

    I would not post the variable over, In this case I personally would send it through the URL and use the $_GET method to retreve it. For Example.
    <html>
         <head>
              <title>Test Page</title>
              <script type="text/javascript">
                   function userID(){
                        //var ID = form1.userIDs.selectedIndex;
                        var user = form1.userIDs.options[form1.userIDs.selectedIndex].value;
                        window.location = "test.html?userID=" + user;
              </script>
         </head>
         <body>
              <form id="form1">
                   <select name="userIDs" id="userIDs" onchange="userID();">
                        <option>Select a User</option>
                        <option value="1">User 1</option>
                        <option value="2">User 2</option>
                        <option value="3">User 3</option>
                        <option value="4">User 4</option>
                   </select>
              </form>
         </body>
    </html>
    //PAGE TO RETRIEVE THE USERNAME
    <?php
    if(isset($_GET['userID'])
         $userID = $_GET['userID'];
         echo $userID;
         die;

Maybe you are looking for

  • Content based routing in PI 7.1?

    Hi Guys, For the normal content based routing in PI 7.1 in the receiver determination step once i select the conditin and in the condition editor to choose the filed, i dont see any interface under the xpath. I dont have any search help option in the

  • Loading a picture with as too fast than normal loading ?

    hello, i want to know if loading a picture from a server with a swf and show it on the stage, (to show it on the web browser) is slower than loading the picture normally (showing it with img tag). thank you for your answer

  • Catch an error in CFMAIL

    Hi guys, I have written a snippet of code <cffunction> <cftry> <cfmail to=[email protected] from=[email protected] subject="Hello" server="10.0.0.1"> #TheFileContents# </cfmail> <cfcatch type="any"> <cfreturn 6> </cfcatch> </cftry> <cfreturn 0> </cff

  • PO without material document

    Hi, What does it mean when a PO does not have a material document? Thanks

  • Can anyone recommend the best adobe ACE revision material/courseware?

    I'm about to revise for a adobe ace in illustrator cs6 can anyone recommend any good courseware other than the program itself? currently looking at classroom in a book and LogicalCHOICE Adobe Illustrator CS6: Part 1 & 2 (is this course just for instr