insert record behavior problem

Although it might be a problem with mysql, I'm not sure. I use the built-in behavior insert record into DMWCS4 to download data from an online form directly to a MySWQL db table that I put in place via phpMyAdmin on the server. The SQL code of the db table is below:

CREATE TABLE "tablename")

"compid' int (11) NOT NULL AUTO_INCREMENT,

'Title' varchar (55) NOT NULL DEFAULT,

Varchar (55) "First name" DEFAULT NULL,

Varchar (55) "First name" DEFAULT NULL,

Varchar (55) 'Company' DEFAULT NULL,

Varchar (55) 'Add1' DEFAULT NULL,

Varchar (55) 'Add2' DEFAULT NULL,

Varchar (55) 'City' NOT NULL,

'The city' varchar (55) DEFAULT NULL,

Varchar (55) 'Postal Code' DEFAULT NULL,

DEFAULT NULL, 'County' varchar (55)

Varchar (55) 'Phone' DEFAULT NULL,

Varchar (55) 'Fax' DEFAULT NULL,

'Email' varchar (55) DEFAULT NULL,

'Do not contact the marker' enum('y','n') NOT NULL DEFAULT 'n',.

PRIMARY KEY ('compid")

) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT = 1;

the problem I have is that when the form is submitted, the Firstname column in the db, regardless of what is written on the form. I tried to change this line:

Varchar (55) "First name" DEFAULT NULL,

TO

Varchar (55) 'Name' NOT NULL,

but when I test the form using MAMP I get the message error '' Firstname' column cannot be null.

I have no idea why this is happening - if I leave the column Firstname as DEFAULT NULL I get no names in the db table, but it won't let me change - any ideas on what is happening here would be greatly appreciated. Thanks in advance.

Just noticed a typo in:

$insertSQL = sprintf ("INSERT INTO panda (title, first name, name, company, Add1, Add2, city, city, zip code, County, phone, Fax, Email, 'Do not contact the marker') VALUES (%s %s %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)',

GetSQLValueString ($_POST ['title'], "text").

GetSQLValueString ($_POST [' name'], "text").

There is a space between the first and last name in the second case. This could well be the cause of the problem.

Tags: Dreamweaver

Similar Questions

  • Insert Record behavior

    Ok

    I asked this question before with no luck, so maybe I have are more detailed. Whe you create a registration form insert I want to know why when you enter information in the database that separate paragraphs in the record is not stored as such when you view the entry.

    I use PHP MySQL. For example, if I get a text of paragraph three of the MYSQL database entry there he displayed as a paragraph of text. I hope that explains what I'm asking. I want to display the data in the same format that it has been entered.

    Darren

    Thanks it works very well. Here I knew that some way to configure PHP well. Thanks again.

    Darren

  • Insert record behavior does not?

    Guys can someone tell me why this page is not working?
    http://www.wvhgc.org/join.asp
    You will need to fill the text with the text as it is validated.
    The problem is that it does not transfer to this page after you have submitted.
    http://www.wvhgc.org/JoinPaymentOptions.html

    Thank you.
    You did point me in the right direction.
    It turns out that my server does not support writing to access databases, so I had to change the database and the connection to MYsql, and then it worked. Thank you very much.

  • Problem with Insert Record

    Hello

    I currently work in the second part of the tutorial "build your first dynamic Web site. The specific page may be found here:

    http://www.Adobe.com/devnet/Dreamweaver/articles/first_dynamic_site_pt2.html

    I spend all this without any problems... until I get to the section called "Test the insert record Behavior. When I get here and open my code in the web browser, the page rest sleep.

    What I have done:

    1A asked a representative of Adobe by phone what they suggest. They had no suggestions and no page to read on.

    2 remove my entire site and has completely and going through the tutorial everything Word for Word. I'm stuck at the same point each time.

    What I need:

    1. any possible solution. I have already read through every possible article, and there is not one that resolves this problem.

    * Note: later in the tutorial, I was told to find the name of the file "php_test.sql" when looking on the files Panel. This file wasn't there. Just thought I would mention it.


    Thank you

    SWEKO wrote:

    Thank you for your understanding.

    No, the file opens. But after all done werecreated, the database was created and the server is connected, the action "Insert record" will not work for my forms.

    I thought that I made a mistake somewhere, so I Redid the entire site. It still does not work.

    Have you checked YOUR code against the working version in the tutorial folder?

    Please copy - paste the code pages here so someone can take a look.

  • CS3 breaks date format in MS Access on insert record

    It's strange.

    I worked on one of my old sites, built in MX 2004. After updating the record insertion on the page using CS3 behavior, I noticed that my date fields are messy. My LCID is set to 2057 UK date (dd/mm/yyyy) format, but it is now getting back to mm/dd/yyyy.

    I recall it being a 'Date, MS Access' option in the ' submit under "fall down on the insert record behavior MX 2004, but this seems to be missing.

    I have nothing on the output allows to reverse the change, so now my old disks display dates in the correct format, and new records have the wrong date on them.

    And of course, you don't notice this error before the 12th of the month, after which the system can decide who should be the month.

    So my clients resonate me up to two weeks after that day to tell me that their application is broken. Arrgh.

    Is there an extension for this problem / add the necessaru to the insertion of a plug or someone behavior at - it a snippet of code that works?

    Is this something a bug in CS3?

    OK, I found a solution quick and dirty, which is basically does not submit the field as a date.

    I found that I needed to change this line of code:

    Quote:
    MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param5", 135, 1, -1, MM_IIF (UploadFormRequest ("article_date_updated"), UploadFormRequest ("article_date_updated"), null)) ' adDBTimeStamp

    with this:

    Quote:
    MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param5", 202, 1, 150, MM_IIF (UploadFormRequest ("article_date_updated"), UploadFormRequest ("article_date_updated"), null)) ' adDBTimeStamp

    The difference being these settings: "135, 1, - 1" becomes "202, 1, 150".»

    I don't understand what these are (can't find a reference for them), but the third should be the length of the string, the first of the type of data (e.g. variable text, number, date) and one in the Middle, unsure, whether his need maybe?

    If the first of these parameters can be set for the exact date, it would be the right solution, but I don't know if this is possible.

    Anyway, the work around is OK - condition that there is sufficient validation on the form to choose the invalid date formats.

  • Yet an another Insert Record problem

    I have two tables
    cities & menus
    I have a registration form insert created from the wizard for each table that I'm inserting records in.

    The first form, I am inserting a "name of the city. When I insert this record, it automatically gives the name of the city a CityID in the database. It works very well.

    The second form, I'm inserting in the fields:
    Restaurant name (this registration automatically creates a RestaurantID
    Name of the city
    Address
    Phone
    Bonnefin

    Once I'm going to insert the record in the table of menus, I get the error saying that "cityID field does not have a default value".

    "CityID" field isn't a default value

    The error occurred in /Applications/ColdFusion8/wwwroot/ncmenus/admin/index.cfm: line 66

    64:, < cfif IsDefined ("FORM.logoImg") AND #FORM.logoImg # NEQ "" > "".
    65: cfqueryparam value = "" #FORM.logoImg # "cfsqltype ="cf_sql_clob"maxlength ="100">"
    66: < cfelse >
    67: "
    68: < / cfif >

    What can I do to fix this?

    I figured this out. I just needed to include a field for cityID and do fill a menu that extracts data from the database of the 'cities '.

  • MySQL Db stopped inserting records

    I'm developing a web site that accepts a user input and adds a new record to a table in a MySQL database. He has worked for a few weeks now add 70 + new test records. Well... I broke something and now he is no longer inserts records but does not give me of all error messages. I did not something obviously wrong with the form, even if I made some changes to the form.just before he fell. I refreshed the server behavior and also tried to delete and recreate the server behavior's done everything to nothing.

    I'd appreciate really some directions on this troubleshooting. I am using DW CS6 and IE11 test, Chrome, FF on Win 7.

    The page that I am developing can be seen here http://www.hollisterairshow.com/rally/vendorApp.php?blapp=yes & tspapp = yes , you will see a 'Send' button and a 'Next step' button, either should work, they both work previously and now none of them work.

    Thanks for any advice on this.

    Tony

    I think that the fault lies soemwhere in your spy validation script. If comment on them you all out (as below) information is sent. (can be a difficult task of isolation that one is causing the problem). You will need to comment on each one individually to find the culprit and see what kind of relationship we have with the form. To me, it seems that the form does NOT work because the validation is perhaps incomplete.

  • PHP and Insert Records form validation

    Hello

    I've been scratching my head for 2 days and could not find a solution.

    Here's my problem:

    Go to http://ecopethandbags.com/contactTest.php and click on the "Send comments" button.

    You will see the validation works.

    Go in http://ecopethandbags.com/contactTestInsert.php , this time, I inserted the server behavior "Insert record".

    Click again on the send comments"" button.

    You will see the naughty message as "'firstname' column cannot be null" in a simple white page.

    My question is:

    How can I insert the form PHP records in my database and take advantage of validation of form as well in http://ecopethandbags.com/contactTest.php

    I enclose files.

    Thank you very much for your help!

    boloco wrote:

    My question is:

    How can I insert records in the form of PHP in my database and enjoy beautifully like form validation in http://ecopethandbags.com/contactTest.php

    Use a simple PHP logic to merge the scripts.

    Dreamweaver automatically updates the server behavior code insert a record into the upper part of the script. You have to adapt so that the validation is done first. If the validation is successful, use the server behavior insert record. If not, display the form again.

    if (array_key_exists('send', $_POST)) {
      // validate the form input
    
      if (!$suspect && empty($missing)) {
      // send the mail
    
        if ($mailSent) {
        unset($missing);
        // insert the Insert Record server behavior code here
        }
      }
    }
    
  • allowing a zero as the first digit in a field of the insert record form

    I have a form that has a behavior applied insert record. I wish I could put a number in one of the fields on form that begins with the letter from scratch (i.e. 010507). The problem is that when I insert a number starting with zero, the first zero of the number gets abandoned when it is entered into the database. This has happened even when I tried to change the number to text field type in Access.

    Oh, I didn't change the field type 'text' in the dialog record insertion as well.

  • Is it possible that when the new record is inserted in a table then this empty inserted record is automatically displayed without scrolling?

    Mr President.

    Is it possible that when the new record is inserted in a table then this empty inserted record is automatically displayed without scrolling?

    Because I change the size property of the table 5 range and my new record is inserted at no 10.

    When I click the addRecord button the new parallel line does not appear, do scroll down to see it.

    I want that we don't have to scroll down.

    The line is displayed automatically.

    as shown in the photo my behavior of page.

    scrolling.png

    Concerning

    If you just need the newly created line to be visible,

    You can simply set contentDelivery = 'immediate' and displayRow = "selected".

    P.S. the blog mentioned above only.

    See you soon

    AJ

  • Insert record does nothing

    Hello

    I'm trying to follow this tutorial to make dynamic Web sites:

    http://www.Adobe.com/devnet/Dreamweaver/articles/first_dynamic_site_pt2.html

    I did part 1 completely and that you was fine until trying to set up the Add Post feature.  The database works well group information in the page manage messages and when I add the server behavior insert record, it looks good, but hitting the "Post!" button does nothing mode live view or in the browser preview.  It does not add the record, nor it redirects to the manage_posts.php link.  There simply nothing even when I'm holding cmd click (I use a Mac).  Other links are working fine.

    I can add a record manually in phpMyAdmin and make it display properly in mode live view on the manage_posts page.

    I use a leapord mac snow running and using the Cloud Dreamweaver CS6 Designer.  Using MAMP for a local server and phpMyAdmin, exactly as they appear in the first part of the tutorial.

    Code is copied below:

    <? php require_once('.. / Connections/check_mag.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via 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 "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "form1")) {}

    $insertSQL = sprintf ("INSERT INTO new (title, blog_entry) VALUES (%s, %s)," ")

    GetSQLValueString ($_POST ["title"], "text").

    GetSQLValueString ($_POST ['blog_entry'], "text"));

    @mysql_select_db ($database_check_mag, $check_mag);

    $Result1 = mysql_query ($insertSQL, $check_mag) or die (mysql_error ());

    $insertGoTo = "manage_posts.php";

    If (isset {}

    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;

    $insertGoTo. = $_SERVER ['QUERY_STRING'];

    }

    header (sprintf ("location: %s", $insertGoTo));

    }

    ? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "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 "/ >"

    Add Post < /title > < title >

    "" < link href = "... / styles/admin.css" rel = "stylesheet" type = "text/css" / >

    < / head >

    < body >

    < h1 > what's the buzz? < / h1 >

    < p > < a href = "index.php" > Admin Menu < /a > < /p >

    < do action = "<?" PHP echo $editFormAction;? ">" id = "form1" name = "form1" method = "POST" >

    < p >

    < label for = "title" > title: & #160; < / label > < input name = "title" type = "text" class = "textfields" id = "title" maxlength = "150" / >

    < /p >

    < p > < label for 'blog_entry' = > Post: & #160; < / label >

    < name textarea = 'blog_entry"cols ="45"lines ="5"id ="blog_entry"form ="form1"> < / textarea >

    < /p >

    < p >

    < input name = "button" type = "button" id = "button" form = "form1" value = "post"! / >

    < /p >

    < input type = "hidden" name = "MM_insert" value = "form1" / >

    < / make >

    < p > < / p >

    < / body >

    < / html >

    Which do not appear to be featured here?  Any help would be greatly appreciated.

    Your "poster!" is a button, not a submit button.  Change to a type = 'submit' and see if it works.

    ^_^

  • Inserting record in the database and then display on the next Page

    Hello!

    For a while since I posted here, but I've been pulling my hair out on this one.  Here's what I want to do.  I have a page that I want to be able to enter text in two form fields, then click on "Insert disc", and then on the next page, I just submit display.  For example, on the "insert.php" page I want to enter the field ID and Joe 43569 in the first name field.  Then after I click on submit (or insert record) the next page will have a text that says: "congratulations Joe, your ID is 43569.»  Have a great day! "Or something to that effect.

    I have the database mySQL, set up and insert records into it since this page works correctly.  Here is the code of my insert.php page which I think is the issue.   I'm just confused as to which should be added to the page detail.php to have this sentence appears correctly.  Is there something that should be added to the code on the page insert.php?  Something after the detail.php on that first line?

    Thank you, thank you, thank you in advance.

    Brent

    $insertGoTo = 'detail.php ';
    If (isset {}
    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;
    $insertGoTo. = $_SERVER ['QUERY_STRING'];
    }
    header (sprintf ("location: %s", $insertGoTo));
    }
    ? > <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "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 >
    < / head >

    < body >
    < do action = "<?" PHP echo $editFormAction;? ">" method = "post" name = "form1" id = "form1" >
    < table align = "center" >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > ID: < table >
    < td > < input type = "text" name = "ID" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > first name: < table >
    < td > < input type = "text" name = "lastName" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > < table >
    < td > < input type = "submit" value = "Insert file" / > < table >
    < /tr >
    < /table >
    < input type = "hidden" name = "MM_insert" value = "form1" / >

    < / make >

    When you submit the form, the form fields values are passed to the query insert as variables of $_POST, but as soon as you redirect the user to another page, these variables are destroyed.

    There are two ways to preserve the values: use sessions and session variables, or add values to the end of the redirect URL query string. Using the variables of session is probably easier since you can do it at the top of the page that inserts data into the database without affecting the code of Dreamweaver Server behavior.

    Put this at the top of the current page:

    
    

    In details.php, add top of the page. You can then use $_SESSION ['ID'] and $_SESSION ['name'] to display the values.

  • Insert server behavior into two tables with ASP.

    How do I change the server behavior code INSERT to insert records into several tables using ASP? Information inserted into the first table includes the customer profile, including the legal name, name and surname. What I can accomplish easily using the server behavior. In the second table I want to insert hidden value in a field that corresponds to the value of the current customerID, as well as the model number of the item purchased. Be very specific that I'm not too familiar with the scripts.

    The standard insert behavior cannot be easily changed to handle multiple
    tables. However there is a very simple tutorial on www.charon.co.uk on the way
    to deal with.

    --
    Paul Whitham
    Certified Professional Dreamweaver MX2004
    Adobe Community Expert - Dreamweaver

    Valleybiz Web design
    www.valleybiz.NET

    "aonefun" wrote in message
    News:emsn18$23F$1@forums. Macromedia.com...
    > How do I change the server behavior code INSERT to insert records in
    > more
    > as a table using ASP? Information inserted into the first table
    > includes a
    > Customer profile, including the company name, name and surname. What I can
    > accomplish easily using the server behavior. In the second table I'd
    > as
    > to insert a hidden field value that is equal to the value of the current
    > customerID, as well as the model number of the item purchased. Please be very
    > specific
    > as I am not too familiar with the scripts.
    >

  • Error when inserting Record with GoDaddy hosting

    When I try to insert a recording on a Web page hosted by GoDaddy in SQL server, I get the error:

    Microsoft OLE DB provider for ODBC error «80040e09» drivers

    [Microsoft] [ODBC SQL Server driver] [SQL Server] EXECUTE permission denied on object 'sp_execute', database 'master', owner 'dbo '.

    This error occurs on the line:

    MM_editCmd.prepared = true

    After some research online if I change the line following the error disappears, but the fact the behavior insert record:

    MM_editCmd.prepared = false

    Is it possible to change the behavior so that it will always use false instead of true and always appear as a behavior on the page.

    What happens in Dreamweaver 8.0.2. It happened not in Dreamweaver MX 2004.

    Thank you
    Mike

    After a lot of tinkering, I tried a test with a new table and web page. Dreamweaver has added the code to insert as before--the same code that causes the error. I tried the test and it worked. No error?

    The only difference I could think about was that the original array was created on a local SQL server server, and then I used generate the SQL Script for the create table statement, I then ran in on the SQL of GoDaddy Server Query Analyzer.

    I then removed the table and created through the user interface of GoDaddy and now it works. I don't know what the difference is, but at least it works.

    Thank you.

  • Insert record

    If I use the behavior is insert record (php) to add a record in a mysql table there a way to automatically return the value of an AutoIncrement field? Thanks in advance for your suggestions.

    MichaelS says:
    > If I use the behavior insert record (php) to add an entry in a mysql table is there a way to automatically return the value of an AutoIncrement field? Thanks in advance for your suggestions.

    http://docs.php.net/manual/en/function.MySQL-insert-ID.php

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for

  • scanning of a document is fractured in several scans of portions of the doc

    Wrelessly Photosmart 6525 connected to the Mac Air.  Analysis about precisely once in five.  Rather than to get an analysis of the unique page placed on the glass, I get several scans of small portions of the single document or, if there is a header,

  • The HP files

    In my HP Pavilion DV6-6156sl pc, there was a terrible rodkit for what I do to format the computer. That's why I lost all the original files of HP. In the pc, I now have Windows 7 Home Premium 64-bit. Please, I would like to know exactly what HP files

  • Needing to have Adobe like choice in drive D...

    With Media Center XP, some CDs that need Adobe to read them are not recognized in the D drive.  How Adobe can be used as a choice to open?  I had the home edition and all the CD work; When tech had computor for overhaul, he installed the Media Center

  • Two questions: Running XP and have some interesting questions at the start and with IE.

    Hi, I try to wear the IT hat and works to clear up some questions on my mother's computer.  #1 I guess that the computer was shipped with a version of Corel Photo software on it and we cannot get rid "Installer" messages at the beginning upward.  We

  • restrict the vlan address mac

    Hello gentlemen, I bought a 48 sf300 and 4 VLANS. How can I restrict the mac address of the device can be connect each vlan? I just want to let macs for vlan, should join the pc to a vlan. Thank you very much!