Insert Record Function

Ok i'v just started with dreamweaver and i'm reading a book
about it "Dreamweaver 8 with asp, coldfusion and PHP".
I'v got to the chapter on user authentication and did
everything the book said to do and got this error
Provider error '80004005'
Unspecified error
/databasetest/Reg.asp, line 2
After doing some reading on the internet i found out this error
is usually caused by permission problems however i change the
permissions for "full controll" for the Internet Guest Account and
not much changed.
please help me, the code i used is below:

Hi Mallikarjuna,
I am trying to pass the rent amount, but unable to, here is the code.
TYPES: BEGIN OF IT_P0581.
INCLUDE STRUCTURE P0581.
TYPES END OF IT_P0581.
DATA: INFTYKEY LIKE BAPIPAKEY,
RETURN LIKE BAPIRETURN1.
DATA: P0581_TAB TYPE TABLE OF IT_P0581 WITH HEADER LINE.
P0581_TAB-PERNR = 01400038.
P0581_TAB-INFTY = '0581'.
P0581_TAB-BEGDA = '20111010'.
P0581_TAB-ENDDA = '99991231'.
P0581_TAB-RTAMT = 3000 .
append P0581_TAB.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = P0581_TAB-INFTY
NUMBER = P0581_TAB-PERNR
SUBTYPE = ''
VALIDITYEND = P0581_TAB-ENDDA
VALIDITYBEGIN = P0581_TAB-BEGDA
RECORD = P0581_TAB
OPERATION = 'INS'
NOCOMMIT = ''
RECORDNUMBER = '000'
DIALOG_MODE = '2'
IMPORTING
RETURN = RETURN
KEY = INFTYKEY
EXCEPTIONS
OTHERS = 0.

Similar Messages

  • PHP/MySQL Insert Record

    I've got a multi page form that carries values across
    multiple pages with the use of Hidden Fields and then on last page
    inserts the record into a MySQL database (for this I used the built
    in Insert Record function of dreamweaver). My problem is that it
    works well when using Internet Explorer, values are carried forward
    and everything is inserted successfully to the database.
    But, when using Mozilla Firefox it looks as if it works, I
    get the confirmation at the end, but the record is not being
    inserted to the database. I've worked through this step by step and
    the values are being carried across in the hidden fields but it
    just will not insert anything to the database.
    Has anyone got any ideas??
    Thank you in advance.

    Cade06 wrote:
    > Thanks alot for your reply, but I am completely new to
    MySQL, and I am not
    > quite sure how the syntax works. When you say " WHERE
    landlord_username =
    > 'whatever' "I'm not sure what needs to go in the
    'whatever' portion of the
    > code. Do I need to insert static text here or something
    else? I am totally out
    > of my element here, sorry :-/
    It's probably not so much MySQL syntax that's the problem for
    you, but a
    lack of understanding how to work with Dreamweaver
    recordsets, server
    behaviors, and sessions. Building database-driven sites with
    Dreamweaver
    isn't difficult, but there are a lot of things involved.
    The Log In User server behavior automatically creates a
    session variable
    called $_SESSION['MM_Username']. You can use this as a
    parameter to pass
    to the SQL query in the Advanced Recordset dialog box. In the
    SQL area
    you would type (I'm guessing the name of your table and the
    username
    column):
    SELECT landlord_id FROM landlords
    WHERE landlord_username = 'col1'
    Then click the plus button above the Variables area, and
    create a
    Parameter with the following values:
    Name: col1
    Default value: 1
    Runtime value: $_SESSION['MM_Username']
    You can then extract the result of the recordset, and assign
    it to a
    session variable like this:
    $_SESSION['landlord_id'] = $row_recordsetName['landlord_id'];
    > Also, I understand that I need to do this on the login
    page, but do I need to
    > define the recordset again on the add_site page as well?
    I guess I'm still not
    > quite clear on how I specify the session variable as the
    value that needs to be
    > entered in the sites table as the landlord_ID.
    As long as the session is still valid (which it would be if
    you use
    Restrict Access to Page), you will always have access to that
    landlord's
    id through $_SESSION['landlord_id'].
    David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    http://foundationphp.com/

  • DW CS3 Insert Record/Update Record: Record Form Wizard Error

    I have just bought Dreamweaver CS3 and I am running into some
    problems. I also have Dreamweaver MX 2004. When I use the Insert
    Record: Record Insertion Form Wizard on my Dreamweaver MX 2004 I
    have no problems using the Insert Record function. However, when I
    use the Dreaweaver CS3, I am running into errors. The error I am
    getting is the following..."Apache HTTP Server has encountered a
    problem and needs to close. We are sorry for the inconvenience."
    As well, when I use the update form wizard, when you place
    all your settings and place a redirection after updating to a page
    it does not do it, it stays on the same page and gives me the
    following error..."Warning: Cannot modify header information -
    headers already sent in C:\wamp\www\edit.php on line 50".
    This happens on all internet browsers when I want to insert a
    new record. It takes a long time to load the page and then it
    finally gives me an error which I stated above. I never had a
    problem before. I thought maybe I installed the application wrong,
    so I unistalled and reinstalled the DW CS3. I still get the same
    issue. I became so frustrated that I formatted my hard drive
    thinking make I have a adware or spyware, so to be cautious I
    formatted my computer and installed everything with a fresh install
    and still I get this error. Now my testing server that I use is
    called WAMP. I never had problems with it before using DW MX 2004
    or when I used the trial of DW 8. So now I am out of options. Is
    there a glitch in the new CS3 Web Premium that includes DW CS3
    upgrade software and if there is, is there a download. Can anyone
    help me, please.

    Please bare with me David. I know something is wrong because
    I have made two folders, one that is done in MX2004 and the other
    done in CS3. CS3 is generating errors. For example. In the insert
    page in MX2004 I do not need to make a recordset, however, for the
    CS3 insert page I noticed when I use the insert record form wizard
    it does not work unless I make a recordset where in MX2004 I did
    not need to do this. I've created a add.php and a edit.php of
    MX2004 and CS3. I will place it in the attach code so you can see
    side by side what it is generating. I can see that there are a few
    things that CS3 does change and some how it is making my internet
    browsers show an error saying......"Warning: Cannot modify header
    information - headers already sent in C:\wamp\www\edit.php on line
    50".
    What do I do?
    I noticed that in the following code difference in...
    MX2004 = <?php echo $row_rsTest['test']; ?>
    CS3 = <?php echo htmlentities($row_rsTest['test'],
    ENT_COMPAT, 'utf-8'); ?>
    There is a big difference.
    My database is the following...
    -- phpMyAdmin SQL Dump
    -- version 2.10.1
    http://www.phpmyadmin.net
    -- Host: localhost
    -- Generation Time: Jun 24, 2007 at 04:29 PM
    -- Server version: 5.0.41
    -- PHP Version: 5.2.3
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    -- Database: `mysample`
    CREATE DATABASE `mysample` DEFAULT CHARACTER SET latin1
    COLLATE latin1_swedish_ci;
    USE `mysample`;
    -- Table structure for table `test`
    CREATE TABLE `test` (
    `testID` int(11) NOT NULL auto_increment,
    `test` longtext NOT NULL,
    PRIMARY KEY (`testID`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
    -- Dumping data for table `test`
    INSERT INTO `test` (`testID`, `test`) VALUES
    (3, 'Sample Test');
    =======================================================================
    I use the program called
    WAMP.
    =======================================================================
    PHP PAGES

  • Exist RFC Function or Bapi for insert Records form a external program?

    i create a Ztable same as tell me here:
    http://abaplovers.blogspot.com/2008/02/creating-table-in-sap.html
    5 String Fileds 2 Date Fields 2 Numeric Fields
    my question is exist a RFC Function or Bapi for insert Records form a external program (Delphi/Visual Basic)?
    Any advices?
    Thanks.

    hi madhurao123 thanks for answer.
    But Why block the Thread?
    This question is no so basic, yet never learn, the forum must be open to these questions maybe open a forum somewhere basic but must be able to do these basic questions.
    IT Toolbox commented the same thing, but if not here or ITtoolbox or where else can ask basic questions?
    Advise me, thank you.

  • Error while inserting records in sqlLite database

    Hi all
    I am building a hybrid web app in SMP using phonegap and html.
    I am trying to insert records in sql database but i get an error with an undefined error code
    Please see below :
    function openDatabaseFoo() {
      db = window.openDatabase(clientDBName, clientDBVersion, clientDBDisplayName, clientDBMaxSize);
    function createDBTables() {
      db.transaction(function(tx) {
      // Create mine table
      var fooCreate = 'CREATE TABLE IF NOT EXISTS ' + fooTable+ ' (empNo, empName)';
      tx.executeSql(fooCreate , [],
      function (tx, resultSet) {
                //success
      var msg = 'Sucessfully created';
      alert(msg);
      logSuccessMessage(msg);
                function (err) {
                //error code
                var msg = "Error creating table = " + err.code;
                alert(msg);
                logErrorMessage(msg);
    the creation of tables is happening properly because i am getting a success message in the alerts.
    I am getting the error when i am trying to insert records in the above table
    function insertDataTable(){
    db.transaction(function(tx) {
    var insertSql = 'INSERT INTO ' + fooTable + ' (empNo, empName) VALUES ("1603","baker")';
    tx.executeSql(insertSql, [],
      function (tx, resultSet) {
                //success
      var msg = 'Sucessful insertingdata.';
      alert(msg);
      logSuccessMessage(msg);
                function (err) {
                //error code
                var msg = "Error inserting data sql = " + insertSql + " Error code = " + err.code;
                alert(msg);
                logErrorMessage(msg);
    can some one please help.Also guide me where can i check the sqlLite database logs to see more about the error.
    I would really appreciate the help.I have been onto this since past few days now
    Regards
    Shweta

    What is err.code, or the value of msg when the error occurs?
    Thanks,
    Andrew.

  • Inserting records into Table with check table logic in place

    I want to insert records into a table, and have the check table to not allow invalid entries.  Is there a function out there that will allow this?  I am currently using the insert statement and it is working except that it is not giving an error when the value does not exist in the check table for the particular fields.
    INSERT INTO ZSD_XREF VALUES WA_XREF.
    That is the basic statement I'm using ZSD_XREF has several fields one being the material number field tied to the check table which happens to be MAKT file.  The insert statement is not validating the material numbers using the check table, or at least it is not giving an error.  Any ideas?

    Paul,
    Unfortunately, open SQL statements such as INSERT, UPDATE do not go through the check table logic as they directly hit the database layer. Check table checks are performed only if you go through application layer that is when you enter the same data through a screen.
    You have to do the checks yourself.
    Happy checking!!!
    Srinivas

  • Insert record and email

    Hello
    How do I insert a record with the image filename into a database, then send the data just entered as an email?
    I was able to do this before but now this new CS3 seems so complicated!
    I am unable to just use an insert record behavior then add form fields and change the insert or update recored behavior like before.
    Please can I be shown some actual working tutorials on this?
    This search function on this forum does not work as I tried to search for this exact statement "insert record and email" and no records appear.
    Cheers

    Ok, here is the entire page:
    <br />
    <br /><?php require_once('Connections/cnreviva.php'); ?>
    <br /><?php<br />// Load the common classes<br />require_once('includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("");<br /><br />// Make unified connection variable<br />$conn_cnreviva = new KT_connection($cnreviva, $database_cnreviva);<br /><br />$editFormAction = $_SERVER['PHP_SELF'];<br />if (isset($_SERVER['QUERY_STRING'])) {<br />  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);<br />}<br /><br />// *** Mail form as Text format ***<br />if (isset($_POST["FX_sendForm"]) && $_POST["FX_sendForm"] == "frmupload") {<br />  $format = strtolower("Text");<br />  if ($format != "html") $format = "plain";<br />  $filefield = "uploadfile";<br />  $top = "\r\n";<br />  $body = "\r\n";<br />  $excludeArray = array("button","button_x","button_y","uploadfile","FX_sendForm","MM_insert","MM_update"); <br />  $i = 0;<br />  while ($i<sizeof($_POST)) {<br />    if (!in_array(key($_POST),$excludeArray)) {<br />      if (is_array(pos($_POST))) {<br />        $postVar = implode(", ", pos($_POST));<br />      } else {<br />        $postVar = pos($_POST);<br />      } <br />      $body .= strtoupper(key($_POST)) . ": " . stripslashes($postVar) . "\r\n";<br />    }<br />    $i++;<br />    Next($_POST);<br />  }  <br />  $bottom = "\r\n";<br />  $from = $_POST["email"];<br />  // set parameters<br />  $recipient = "[email protected]";<br />  $subject = "Test";<br />  $message = $top . $body . $bottom;<br />  // set extra parameters<br />  $headers = "From:" . $from . "\r\n";<br />  $headers .= "Cc:\r\n";<br />  $headers .= "Bcc:\r\n";<br />  require_once("FXInc/FX_mailForm_php.inc");<br />  // send all<br />  mail($recipient, $subject, $message, $headers);<br />  $body = urlencode(str_replace("\r\n", "<br>", $body));<br />  $redirect = "thankyou.php";<br />  if ($redirect) header("Location: " . $redirect);<br />}<br /><br />// Make an insert transaction instance<br />$ins_tblfeedback = new tNG_insert($conn_cnreviva);<br />$tNGs->addTransaction($ins_tblfeedback);<br />// Register triggers<br />$ins_tblfeedback->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");<br />$ins_tblfeedback->registerTrigger("END", "Trigger_Default_Redirect", 99, "thankyou.php");<br />// Add columns<br />$ins_tblfeedback->setTable("tblfeedback");<br />$ins_tblfeedback->addColumn("name", "STRING_TYPE", "POST", "");<br />$ins_tblfeedback->addColumn("email", "STRING_TYPE", "POST", "");<br />$ins_tblfeedback->addColumn("city", "STRING_TYPE", "POST", "");<br />$ins_tblfeedback->addColumn("country", "STRING_TYPE", "POST", "");<br />$ins_tblfeedback->addColumn("shoe_size", "STRING_TYPE", "POST", "");<br />$ins_tblfeedback->addColumn("feedback", "STRING_TYPE", "POST", "");<br />$ins_tblfeedback->addColumn("activate", "STRING_TYPE", "POST", "", "N");<br />$ins_tblfeedback->addColumn("photo", "FILE_TYPE", "FILES", "uploadfile", "");<br />$ins_tblfeedback->setPrimaryKey("id", "NUMERIC_TYPE");<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rstblfeedback = $tNGs->getRecordset("tblfeedback");<br />$row_rstblfeedback = mysql_fetch_assoc($rstblfeedback);<br />$totalRows_rstblfeedback = mysql_num_rows($rstblfeedback);<br />?>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <br />
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <br />
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <br />
    <br />
    <br />
    <br />
    <form action="%3C?php%20echo%20$editFormAction;%20?%3E" method="post" name="frmupload" id="frmupload">
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <table width="300" border="0" cellspacing="0" cellpadding="5">
    <tr>
    <td>Name
    <br />
    <br />
    <input type="text" name="name" id="name" length="20" value="" /></td>
    </tr>
    <tr>
    <td>Email
    <br />
    <br />
    <input type="text" name="email" id="email" length="20" value="" /></td>
    </tr>
    <tr>
    <td>City
    <br />
    <br />
    <input type="text" name="city" id="city" length="20" value="" /></td>
    </tr>
    <tr>
    <td>Country
    <br />
    <br />
    <input type="text" name="country" id="country" length="20" value="" /></td>
    </tr>
    <tr>
    <td>Image
    <br />
    <br />
    <input name="uploadfile" type="file" id="uploadfile" /></td>
    </tr>
    <tr>
    <td>&#160;</td>
    </tr>
    <tr>
    <td>
    <?php<br /> echo $tNGs->getErrorMsg();<br />?>
    <input type="submit" name="button" id="button" value="Submit" />
    </td>
    </tr>
    </table>
    <br />
    <input type="hidden" name="FX_sendForm" value="frmupload" />
    <br /></form>
    <br />
    <p>&#160;</p>
    <br />
    <br />

  • Inserting records into a table with all caps

    Hello
    I have a procedure that inserts records into a table. How do I ensure that the text values inserted are recorded all capital letters into the table?
    Thanks.

    You can use UPPER(..) function in your insert statement, so that values are converted to UPPER, before insert.
    If you want to check at table level, you can achieve that by writting a before insert trigger and in that trigger check
    IF UPPER(:new.<col>) != :new.<col> THEN
    RAISE_APPLICATION_ERROR(-20101,'Error: Not all values are in upper case')
    END IF;

  • Inserting records in transformation vs 7 w/o coding

    Hello,
    Until release 3.5 there was a possibility to copy single characteristics or key figures within an update rule , and then modify the key of this copied characteristic by double-clicking in it. By changing the assigned key it was possible to insert new records at different levels within the same ODS.
    I have tried to find a similar functionality in release 7, but basically it seems that now the key is not defined anymore at the characteristic (or KF) level, but only once for the entire transformation (as a header).
    Does anyone know if any insertion functionality is still available in release 7, or is there now only the 'Abap solution' through routine insertion left?
    Thanks,
    Thierry Brazerol

    No, with this solution it was not necessary to use a return table. You just had to:
    1. Copy a characteristic within the update rule (If I remember properly by right-click on the rule's characteristic or KF)
    2. Access the key of this characteristic, and manually change the key, let's say change a field of the key with for example a constant, which previously was set to 1, and that you set to 2 in the copied characteristic's update rule.
    The result would have been the creation of two entries out of one entry, with two different keys: once with the constant 1 in the key, and a second entry with constant 2.
    But honestly, I have seen in SAP's doc for release 7 a mention that it was possible to insert records in transformations, but never a solution for it (except Abap start/end routine). The fact that the key is now defined at header level makes me really think that this functionality has simply been removed! To bad, it was useful once you knew how to use it...

  • Retrive a record before the last inserted record

    Hi,
    I use simple select statement to retrive records where cola = 'Yes':
    select * from tbl1
    where cola = 'Yes';
    The result gives me about 10 records with different date.
    From the above result, I want to get the record right before the last inserted record according to the date field; which means I can not use MAX function (all I want just one record).
    If I write a function to return a date and passes it back to the SELECT statement, I'll get a date for each record, which I don't want.
    I know there's a way to do that in PL/SQL.
    Plese help me.
    pem

    select * from (
    select * from
    (select * from (select * from (table> order by <date> desc) where rownum < 3)
    order by <date>) where rownum =1

  • [Solved] Unable to insert records, trigger is showing mutating error

    Friends,
    I created a procedure
    ===>>
    SQL> CREATE OR REPLACE PROCEDURE PO_RECEIVINGS_ASSETS_TR_P
    2 IS
    3 CURSOR CUR_LAST_DAY_RCV IS
    4 SELECT * FROM PO_RECEIVINGS_INSTANT_V WHERE TRANSACTION_ID = (SELECT MAX(TRANSACTION_ID) FROM PO_RECEIVINGS_INSTANT_V);
    5 BEGIN
    6 FOR REC_LAST_DAY_RCV IN CUR_LAST_DAY_RCV
    7 LOOP
    8 FOR i IN 1 .. REC_LAST_DAY_RCV.QUANTITY
    9 LOOP
    10 INSERT INTO ND_TEST VALUES(REC_LAST_DAY_RCV.TRANSACTION_ID, REC_LAST_DAY_RCV.CREATION_DATE, REC_LAST_DAY_RCV.QUANTITY,
    11 REC_LAST_DAY_RCV.PO_LINE_ID);
    12 END LOOP;
    13 END LOOP;
    14 END;
    15 /
    Procedure created.
    <<===
    then created a trigger to insert record in ND_TEST when a record is inserted in RCV_TRANSACTIONS_ND
    ===>>
    SQL> CREATE OR REPLACE TRIGGER PO_RECEIVINGS_INTO_ASSETS_TR
    2 AFTER INSERT ON RCV_TRANSACTIONS_ND
    3 FOR EACH ROW
    4 BEGIN
    5 IF :NEW.TRANSACTION_TYPE = 'ACCEPT' THEN
    6 PO_RECEIVINGS_ASSETS_TR_P;
    7 END IF;
    8 END;
    9 /
    Trigger created.
    <<===
    when I try to insert record in RCV_TRANSACTIONS_ND, I get below lines.
    ===>>
    SQL> INSERT INTO RCV_TRANSACTIONS_ND (TRANSACTION_ID,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,
    2 CREATED_BY,TRANSACTION_TYPE,TRANSACTION_DATE, QUANTITY, UNIT_OF_MEASURE, SHIPMENT_HEADER_ID,
    3 SHIPMENT_LINE_ID,USER_ENTERED_FLAG, PO_HEADER_ID, PO_LINE_ID)
    4 VALUES(1001001,SYSDATE,3572,SYSDATE,3572,'ACCEPT',SYSDATE,1,'Nos',199999,199099,'Y',133032,1679
    29);
    INSERT INTO RCV_TRANSACTIONS_ND (TRANSACTION_ID,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,
    ERROR at line 1:
    ORA-04091: table RCV_TRANSACTIONS_ND is mutating, trigger/function may not
    see it
    ORA-06512: at "PO_RECEIVINGS_ASSETS_TR_P", line 4
    ORA-06512: at "PO_RECEIVINGS_ASSETS_TR_P", line 6
    ORA-06512: at "PO_RECEIVINGS_INTO_ASSETS_TR", line 3
    ORA-04088: error during execution of trigger
    'PO_RECEIVINGS_INTO_ASSETS_TR'
    <<===
    Using Database 9i.

    Well, I tried to solve it and it worked.
    SQL> CREATE OR REPLACE PROCEDURE PO_RECEIVINGS_ASSETS_TR_P(VAL1 IN NUMBER, VAL2 IN DATE, VAL3 IN NUMBER, VAL4 IN NUMBER)
    2 IS
    3 BEGIN
    4 FOR i IN 1 .. VAL3
    5 LOOP
    6 INSERT INTO ND_TEST VALUES(VAL1, VAL2, VAL3, VAL4);
    7 END LOOP;
    8 END;
    9 /
    Procedure created.
    ===
    SQL> CREATE OR REPLACE TRIGGER PO_RECEIVINGS_INTO_ASSETS_TR
    2 AFTER INSERT ON RCV_TRANSACTIONS_ND
    3 FOR EACH ROW
    4 BEGIN
    5 IF :NEW.TRANSACTION_TYPE = 'ACCEPT' THEN
    6 PO_RECEIVINGS_ASSETS_TR_P(:NEW.TRANSACTION_ID, :NEW.CREATION_DATE, :NEW.QUANTITY, :NEW.PO_LINE_ID);
    7 END IF;
    8 END;
    9 /
    Trigger created.
    ===
    SQL> INSERT INTO RCV_TRANSACTIONS_ND (TRANSACTION_ID,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,
    2 CREATED_BY,TRANSACTION_TYPE,TRANSACTION_DATE, QUANTITY, UNIT_OF_MEASURE, SHIPMENT_HEADER_ID,
    3 SHIPMENT_LINE_ID,USER_ENTERED_FLAG, PO_HEADER_ID, PO_LINE_ID)
    4 VALUES(1001001,SYSDATE,3572,SYSDATE,3572,'ACCEPT',SYSDATE,1,'Nos',199999,199099,'Y',133032,1679
    29);
    1 row created.
    ===
    Thanks everyone

  • Problem inserting record using INSERT INTO

    I am an amateur web builder using some ColdFusion functionality to access information on an Access database. I know very little about ColdFusion syntax, but I'm using Dreamweaver CS3 to help generate most of the code. I'm working on an insert record page to create a user database with login information. I'm not sure what the problem is, but I'm getting a syntax error referencing this particular portion of the code:
    Syntax error in INSERT INTO statement.
    The error occurred in C:\ColdFusion9\wwwroot\Everett\register.cfm: line 22
    Below is the entire page with line 22 (referenced in the error message) in red. Any ideas?
    <cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
    <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "register">
      <cfquery datasource="everettweb">  
        INSERT INTO Users ([First Name], [Last Name], [Email Address], Password)
    VALUES (<cfif IsDefined("FORM.first_name") AND #FORM.first_name# NEQ "">
    <cfqueryparam value="#FORM.first_name#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.last_name") AND #FORM.last_name# NEQ "">
    <cfqueryparam value="#FORM.last_name#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.email") AND #FORM.email# NEQ "">
    <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.password") AND #FORM.password# NEQ "">
    <cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
      </cfquery>
      <cflocation url="register_success.cfm">
    </cfif>
    <!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"><!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Everett Music Department, Everett, MA</title>
    <!-- InstanceEndEditable -->
    <style type="text/css">
    <!--
    body {
    background-color: #660000;
    -->
    </style>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //-->
    </script>
    <!-- InstanceBeginEditable name="head" -->
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    <!-- InstanceEndEditable -->
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    a:link {
    color: #660000;
    a:visited {
    color: #A01D22;
    a:hover {
    color: #FFCC00;
    -->
    </style>
    <link href="main.css" rel="stylesheet" type="text/css" />
    </head>
    <body onload="MM_preloadImages('menu_about_over','menu_ensembles_over.jpg','menu_schools_over.j pg','menu_events_over.jpg','menu_faculty_over.jpg','menu_contacts_over.jpg','menu_home_ove r.jpg','menu_about_over.jpg','menu_links_over.jpg','menu_login_over.jpg')">
    <table width="960" align="center" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="3"><img src="top_border.jpg" width="960" height="20" align="top" /></td>
      </tr>
      <tr align="center">
        <td colspan="3"><a href="index.php"><img src="e_oval_top.jpg" height="100" width="270" border="0" /></a><a href="index.php"><img src="header.jpg" height="100" width="690" border="0" /></a></td>
      </tr>
      <tr>
        <td height="35" width="301"><a href="index.php"><img src="e_oval_bottom.jpg" height="35" width="234" border="0" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','menu_home_over.jpg',1)"><img src="menu_home.jpg" width="67" height="35" name="home" border="0" id="home" /></a></td>
        <td width="251"><ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a class="MenuBarItemSubmenu" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','menu_about_over.jpg',1)"><img src="menu_about.jpg" width="71" height="35" name="about" border="0" id="about" /></a>
            <ul>
              <li><a href="#">News</a></li>
              <li><a href="#">History</a></li>
              <li><a href="#">Media</a></li>
            </ul>
          </li>
          <li><a class="MenuBarHorizontal" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('ensembles','','menu_ensembles_over.jpg',1)"><img src="menu_ensembles.jpg" width="98" height="35" name="ensembles" border="0" id="ensembles" /></a>
            <ul>
              <li><a href="#">Band</a></li>
              <li><a href="#">Chorus</a></li>
              <li><a href="#">Strings</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('schools','','menu_schools_over.jpg',1)"><img src="menu_schools.jpg" width="82" height="35" name="schools" border="0" id="schools" /></a>
            <ul>
              <li><a href="#">Everett High School</a></li>
              <li><a href="#">English School</a></li>
              <li><a href="#">Keverian School</a></li>
              <li><a href="#">Lafayette School</a></li>
              <li><a href="#">Parlin School</a></li>
              <li><a href="#">Webster School</a></li>
              <li><a href="#">Whittier School</a></li>
            </ul>
          </li>
        </ul>
        </td>
               <td width="408"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('events','','menu_events_over.jpg',1)"><img src="menu_events.jpg" width="74" height="35" name="events" border="0" id="events" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('faculty','','menu_faculty_over.jpg',1)"><img src="menu_faculty.jpg" width="79" height="35" name="faculty" border="0" id="faculty" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('links','','menu_links_over.jpg',1)"><img src="menu_links.jpg" width="66" height="35" name="links" border="0" id="links" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('login','','menu_login_over.jpg',1)"><img src="menu_login.jpg" name="login" width="69" height="35" border="0" id="login" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','menu_contact_over.jpg',1)"><img src="menu_contact.jpg" width="100" height="35" name="contact" border="0" id="contact" /></a><img src="menu_spacer_end.jpg" width="20" height="35" /></td>
      </tr>
      <tr height="10">
        <td colspan="3"><img src="menu_bottom_spacer.jpg" height="10" width="960" /></td>
      </tr>
    </table>
    <table width="960" cellpadding="0" cellspacing="0" align="center">
      <tr height="50">
        <td width="30" background="left_border.jpg"><img src="clear.gif" width="30" height="50" /></td>
        <td width="900" bgcolor="#FFFFFF">
          <table width="900" cellpadding="0" cellspacing="0">
            <tr>
              <td width="900" height="350" valign="top"><!-- InstanceBeginEditable name="PageBody" -->
          <form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" name="register" preloader="no" id="register">
                <table width="100%">
                  <tr>
                    <td colspan="2" class="heading1">Fill in the information below to register for this site:</td>
                  </tr>
                  <tr>
                    <td colspan="2"><img src="clear.gif" height="15" /></td>
                  </tr>
                  <tr>
                    <td width="50%" class="form" align="right">First Name:</td>
                    <td width="50%"><span id="sprytextfield1">
                      <input type="text" name="first_name" required="yes" id="first_name" width="150" typeahead="no" showautosuggestloadingicon="true" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Last Name:</td>
                    <td><span id="sprytextfield2">
                      <input type="text" name="last_name" required="yes" id="last_name" width="150" typeahead="no" showautosuggestloadingicon="true" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Email Address:</td>
                    <td><span id="sprytextfield3">
                    <input type="text" name="email" validate="email" required="yes" id="email" width="150" typeahead="no" showautosuggestloadingicon="true" />
                    <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Confirm Email Address:</td>
                    <td><span id="sprytextfield4"><span id="ConfirmWidget">
                    <input type="text" name="email_confirm" validate="email" required="yes" id="email_confirm" width="150" typeahead="no" showautosuggestloadingicon="true" />
                    <span class="confirmInvalidMsg">The values do not match</span></span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Password:</td>
                    <td><span id="sprytextfield5">
                      <input type="password" name="password" required="yes" id="password" width="150" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Confirm Password:</td>
                    <td><span id="sprytextfield6"><span id="ConfirmWidget">
                      <input type="password" name="password_confirm" required="yes" id="password_confirm" width="150" />
                      <span class="confirmInvalidMsg">The values do not match</span></span></span></td>
                  </tr>
                  <tr>
                    <td> </td>
                    <td><input name="submit" type="submit" id="submit" value="Register" /></td>
                  </tr>
                </table>
          <input type="hidden" name="MM_InsertRecord" value="register" />
          </form>
          <script type="text/javascript">
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email");
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
    //-->
    </script>
    <script type="text/javascript">
    var ConfirmWidgetObject = new Spry.Widget.ValidationConfirm("sprytextfield4", "email");
    var ConfirmWidgetObject = new Spry.Widget.ValidationConfirm("sprytextfield6", "password");
    </script>
              <!-- InstanceEndEditable --></td>
            </tr>
          </table>
        </td>
        <td width="30" background="right_border.jpg"><img src="clear.gif" width="30" height="50" /></td>
      </tr>
      <tr>
        <td colspan="3" background="footer.jpg" class="footer" height="80"/>This website best viewed using:<br /><a href="http://www.firefox.com"><img src="firefox_logo.gif" width="110" height="40" border="0" /></a></td>
      </tr>
    </table>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    <!-- InstanceEnd --></html>

    Syntax error in INSERT INTO statement.  INSERT INTO Users ([First Name], [Last Name], [Email Address], Password)
    That oh-so-uninformative error is because "Password" is a reserved word with your database driver.  Either escape it by putting square brackets around it too, or rename the column permanently. It is best to avoid using reserved words whenever possible. So renaming the column is the better option.  Also, I would try and avoid using invalid characters like spaces in column names ie "First Name". It is technically allowed, but it requires special handling everywhere which adds unecessary complexity.
    I'm not sure what the problem is, but I'm getting a syntax error referencing this particular portion of the code:
    Do not take the error line numbers as gospel. Sometimes they just indicate that the error is within the vincinty of that line.
    I'm using Dreamweaver CS3 to help generate most of the code
    Unforutnately, DW wizards generate some truly awful and verbose code.  To give you an idea, here is what the query should look like, without all the wizard nonsense.
      <cfparam name="FORM.first_name" default="">
      <cfparam name="FORM.last_name" default="">
      <cfparam name="FORM.email" default="">
      <cfparam name="FORM.FORM.password" default="">
      <cfquery datasource="YourDSNName"> 
        INSERT INTO Users ([First Name], [Last Name], [Email Address], [Password])
        VALUES (
          <cfqueryparam value="#FORM.first_name#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.last_name#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_varchar">
      </cfquery>
    CF is pretty easy to learn. You might want to begin perusing the CF documentation and a few tutorials to get more familiar with the language. Since you are working with a database, I would also recommend a  SQL tutorial.

  • PHP URL Variable from Insert Record Issue

    I have a very simplistic forum style website I have put together. Everything is functionally properly except for one aspect. The basic structure is a page that lists the existing threads (ie: ThreadA, ThreadB, and ThreadC). I have the name of these threads stored in a MySQL database table that is used to generate a repeating dynamic table to grow as the number of threads increases. If the user clicks on one of these links they are taken to a page that displays all of the comments pertaining to that thread. All of the comments are stored in another MySQL database table. I perform a query on this comments page to filter the information in the comments database by the thread name which is passed over from the first page via a URL variable. The link attached to the name of the thread in the repeating table that generates the URL variable is "comments.php?thread=<?php echo $row_threads['threadName']; ?>" This works perfectly, If the user clicks on ThreadB they are taken to the comments page where only the comments pertaining to ThreadB have been filtered and displayed. After the user inserts a comment form ThreadB the comments page reloads displaying the newly created comment.
    Also, on the first page, the user has the option to create a new thread; call it ThreadD. The name of this new thread has to be inserted into two tables; one in the master threads table and one in the comments page any time someone adds a comment. (I'm sure there is a better way to structure this, but this was all I could figure out and for my purposes at hand it is sufficient). When the user is taken to this new comment page I have a query set up to pull the last entry in the threads table from the logged in user, ie the newly created thread topic. I have dragged this query to the page to make sure it is pulling the correct thread heading, and it works just fine. What I'm wanting to have happen is after the user enters the first comment I'm wanting them to be redirected to the main comments page with their new comment listed; giving the illusion that the new comment and existing comments page are the same. I'm trying to pass the newly created thread name, ThreadD, in the URL to the main comments page just like I do if they select it from the existing threads page. Under the insert record wizard I click the 'browse' button to select the comments.php page. I then select 'parameters' to add the thread name query as the URL parameter. The generated code is "comments.php?thread=" . $row_threadName['threadName'] . "". The user does go to the main comments page but the URL variable is not coming with it. What I'm left with in the address bar is ..."/comments.php?thread=&" , but it should be ..."comments.php?thread=ThreadD". I tried copying and pasting the URL link from the existing threads page since that works perfectly, and when I do that the main comments page shows up blank after being redirected from the new comments page. If I hard code this, for testing purposes, into the redirect after insertion section (ie: "comments.php?thread=ThreadD") everything works perfectly and the URL in the address bar of the main comments page is "...comments.php?thread=ThreadD&" I noticed the extra "&", but didn't give it much thought since the site is giving me the behavior I'm looking for. My question is, how do I get this new comment page to pass the variable of the newly created thread name to the main comments page to behave like it does when the thread is selected from the list of existing threads? I know it has to do with how the URL variable is either being generated or built from my query, or how I have it listed in the redirect section of the insert wizard, but I can't figure out where I am going wrong. Please let me know if there are any questions or if I need to clarify any aspect. Any and all help is always appreciated. Thank you.

    Ok, so just to summarize so I am understanding this correctly.  You have an ordering page for tires/wheels.  A customer places an order for tires/wheels and the data is submitted successfully and this includes a symbol for measurement (in.).  But on another summary page the symbol is returning a blank value.
    If this is correct we need to see:
    - First, the code that is inserting the symbol to the database table in question
    - Second, the query and code where you are printing the data to the screen.

  • [php+mysql] how to get the inserted record ID?

    Hi all,
    I have a standard php page that inserts a record in a mysql
    db.
    is there a way to save the record ID on a session variable
    just after
    storing the new record on the db? I would like to be able to
    get this
    record ID on a specific page where I would allow the user to
    print
    this specific record, by filtering the db by this session
    variable.
    I can use MX Kollection (last version, not PRO).
    TIA
    tony

    >...
    >mysql_query(...);
    >$_SESSION['lastId'] = mysql_insert_id();
    >HTH
    >Micha
    Hi Micha,
    I think that it a bit more complicated.
    I can't find any occurrence of that mysql call.
    I used MX Kollection INSERT FORM function.
    here is the code (partially):
    ===============================
    <? // 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_test_conn = new KT_connection($tes_conn,
    $database_test_conn);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $tNGs->prepareValidation($formValidation);
    // End trigger
    // Make an insert transaction instance
    $ins_rl_test = new tNG_insert($conn_test_conn);
    $tNGs->addTransaction($ins_rl_test);
    // Register triggers
    $ins_rl_test->registerTrigger("STARTER",
    "Trigger_Default_Starter", 1,
    "POST", "KT_Insert1");
    $ins_rl_test->registerTrigger("BEFORE",
    "Trigger_Default_FormValidation", 10, $formValidation);
    $ins_rl_test->registerTrigger("END",
    "Trigger_Default_Redirect", 99,
    "2.php?idp1={id_rl}");
    // Add columns
    $ins_rl_test->setTable("rl_test");
    $ins_rl_test->addColumn("nome_rl", "STRING_TYPE", "POST",
    "nome_rl");
    $ins_rl_test->addColumn("cognome_rl", "STRING_TYPE",
    "POST",
    "cognome_rl");
    $ins_rl_test->addColumn("datanascita_rl", "DATE_TYPE",
    "POST",
    "datanascita_rl");
    $ins_rl_test->addColumn("cancellato_rl", "STRING_TYPE",
    "POST",
    "cancellato_rl");
    $ins_rl_test->addColumn("cancellato_data_rl", "DATE_TYPE",
    "POST",
    "cancellato_data_rl");
    $ins_rl_test->setPrimaryKey("id_rl", "NUMERIC_TYPE");
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rsrl_test = $tNGs->getRecordset("rl_test");
    $row_rsrl_test = mysql_fetch_assoc($rsrl_test);
    $totalRows_rsrl_test = mysql_num_rows($rsrl_test);
    ?>
    ===========================
    as you can see, all data is processed by other functions in
    other
    included files.... :(.
    I think I need to better understand the TNG engine and try to
    create a
    little trigger that creates a session variable just after
    inserting
    the record in the db.
    I already tried to do so, honestly, but with really poor
    results.
    Ciao Micha. ;).
    tony

  • Insert Record and Redirect Data

    I have a website where we are adding articles to categories.
    I need to be able to have a user add an article and then have the
    option to add that same article into another category.
    I'm using the INSERT RECORD behavior now but I'm looking for
    an extension that will INSERT RECORD plus redirect the record/data
    to another page so the user can add it to another category.

    I found this in the upload scripts read me file:
    The clsUpload object contains public functions and methods
    which enable you to upload and save files to a web server using
    pure VBScript.
    Read only
    Data Type: Dictionary Collection
    Syntax: object.Form
    Returns a Forms collection consisting of all the Form objects
    parsed from the HTTP header.
    This collection contains all the HTML form elements which are
    not "Files"
    This collection should be used instead of the typical
    "request.form" method to access data from the other form elements
    (if you decide to combine "file" upload elements with other form
    element types, like checkboxes, text boxes, drop-down lists,
    textareas). Why? Because the form data is posted using
    "multipart/form-data" encoding (and needs to be retrieved like
    binary data instead of text data) and therefore the typical
    "request.form" method isn't effective.
    I changed request.form to clsUpload.form but it still did not
    work.

Maybe you are looking for