Php/MySQL database insert record issue...

I have a php page that adds an "order" to a mysql database table (orders). One text field in the form is for tires/wheels. The description of the wheels often includes the " symbol for inches after a number....Everything submits fine, however when I look at the page that displays the orders all the data after the " symbol including the " symbol is gone... DOes anyone have any idea why this may be happening? It is requiring us to return and edit that area repeatedly. Any help is appreciated greatly. Thanks for your time.

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.

Similar Messages

  • PHP/MySQL-Update/Insert Record JavaScript Won't Work!!!

    Hi. I'm consistently running into the following error when I use the update or insert record script in CS4. I've tried deleting the FileCache file. I've tried quitting and relaunching, etc. Anyone else seeing this happen? Solutions anyone? Thanks in advance...
    I'm beginning to think it has something to do with the database, and not the script. Does anything in the screenshot below look wrong or problematic?
    Okay, I found the problem. Shouldn't be a problem, but it is...
    The Field name "length" changed to "height" eliminated the problem. So, you can't use the word "length" in a field? Sounds weird to me.

    airsoftie wrote:
    Okay, I found the problem. Shouldn't be a problem, but it is...
    The Field name "length" changed to "height" eliminated the problem. So, you can't use the word "length" in a field? Sounds weird to me.
    There are lots of words you can't use for column names in MySQL, but "length" isn't one of them. See http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html.
    The problem arises because Dreamweaver uses JavaScript behind the scenes to populate dialog boxes and build server behaviors. In JavaScript, "length" is the property of an array. I suspect the problem is that using "length" as a column name has given the relevant JavaScript used by Dreamweaver indigestion.

  • PHP MySQL database

    How to send a number count to the PHP MySQL database everytime a details page is opened from the results page?

    Assuming your DB table named 'stats' has fields for article_id, hits and the article id is passed to the detail page through the URL parameter article_id then your query would look like this:
    mysql_select_db($database_XXXXXX, $XXXXXX);
    if (isset($_GET['article_id'])) {
    $article_id = $_GET['article_id'];
    $query_hits = sprintf("UPDATE stats
    SET hits = hits+1
    WHERE article_id = %s", GetSQLValueString($article_id, "int"));
    $hits = mysql_query($query_hits, $XXXXXX) or die(mysql_error());

  • 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.

  • Mysql database, counting records

    Hi!
    I have to store measured data to MySQL database. During this process I would like to count a number of records in a database table. It is also necessary to filter records. I'm using the SQL statement as follows:
    SELECT COUNT (fieldname) AS cnt FROM table WHERE condition
    Because I haven't got any result I've created a small database "mysweetdb" and table "icecream" to test my VIs (see picture bellow).
    The VI is attached. The result of counting is a 2D array (DB Tools Fetch Recordset Data.VI output) with one element (one row and one column). This element contains no data.
    I usually don't give up easily so I've created a similar MS ACCESS database and counted data in it. I've got a correct answer: 3. So it might be possible that there is something wrong with MySQL driver. But I've created a small Delphi project and I've counted records in MySQL database and MS ACCESS database. Both results were correct.
    Can anyone explain where is the problem in communication between LabView and MySQL database?
    Versions: XAMPP for Windows 1.7.3, LabView Developer Suite 2010 SP1, MySQL 5.1 ODBC driver
    Thanks in advance for your suggestions.
    Attachments:
    Count records.vi ‏19 KB

    ContDivConsult,
    thank you for your answer. An updated version of my VI is attached. It uses two options: LabSQL library and DB Connectivity Toolkit. LabSQL gives correct results.
    Regards,
    Ljubo.
    Attachments:
    Count records.vi ‏25 KB

  • Hold carriage returns in PHP MySQL database?

    I'm creating a limited news database for a not-for-profit
    site and I want to let admin users write a long entry which may
    include multiple paragraphs (i.e. carriage returns) and even bold
    text for subheadings would be nice. I haven't been able to find out
    the proper code and DB settings to allow users to do this.
    Anyone have a simple solution?

    The way I handle text formatting with dynamic data is to
    carefully construct
    your DB with formatting in mind
    Create separate fields for headlines and copy. When you call
    the data to
    your web page surround the heading with the desired tag. Of
    course you will
    not always have a heading, so, to eliminate empty spaces add
    a conditional
    statement to ignore the field if it is null.
    like this:
    database:
    news_id
    news_headline1
    news_copy1
    news_headline2
    news_copy2
    web page:
    <?php if (strlen($row_getNews['news_headline1']) > 0)
    {?>
    <h3><?php echo $row_getNews['news_headline1'];
    ?></h3>
    <?php }?>
    <p><?php echo $row_getNews['news_copy1'];
    ?></p>
    <?php if (strlen($row_getNews['news_headline2']) > 0)
    {?>
    <h3><?php echo $row_getNews['news_headline2];
    ?></h3>
    <?php }?>
    <?php if (strlen($row_getNews['news_copy2']) > 0)
    {?>
    <p><?php echo $row_getNews['news_copy2'];
    ?></p>
    <?php }?>
    Jeff
    "Justin from Indiana" <[email protected]>
    wrote in message
    news:fiimo4$33$[email protected]..
    > I'm creating a limited news database for a
    not-for-profit site and I want
    > to
    > let admin users write a long entry which may include
    multiple paragraphs
    > (i.e.
    > carriage returns) and even bold text for subheadings
    would be nice. I
    > haven't
    > been able to find out the proper code and DB settings to
    allow users to do
    > this.
    >
    > Anyone have a simple solution?
    >

  • PHP/MySQL field recognize carriage returns?

    I'm a novice PHP/MySQL database driven site builder. I need
    to have users enter text into a field with carriage returns and
    have the database recognize and store those carriage returns so it
    displays when the data is displayed on a PHP page.
    How do I do this and please keep it simple?
    Do I need to use a particular type of MySQL datafield?
    Will I be able to use the same code on an "update"
    page?

    quote:
    Originally posted by:
    geschenk
    >>
    so it displays when the data is displayed on a PHP page
    >>
    if you just need to replace the \n - type line breaks
    generated by multiline textareas with <br /> on a page, just
    use PHP´s native "nl2br"
    (new line to break) function:
    <?php echo nl2br($row_queryname['field_name']); ?>
    That works... sort of...
    When I use the update page to modify the entry it puts the
    proper "br" code in it's proper place. However when I return to
    that page to edit the text again (as my customer likely will), it
    displays the "br" code in the text field, and if I submit the
    update with the "br" code in place, it duplicates the "br" code
    again, so I get double "br" statements. How do I get the update
    field to read the "br" code back as carriage returns?
    In addition, my insert page uses the following code to write
    the original entry, and I'm not sure where to place the "nl2br"
    statement in the following query (generated by WebAsssist DW
    extensions):
    <?php
    // WA Application Builder Insert
    if (isset($_POST["Insert_x"])) // Trigger
    $WA_connection = $nm_connect;
    $WA_table = "tb_news";
    $WA_sessionName = "WADA_Insert_tb_news";
    $WA_redirectURL = "tb_news_Results.php";
    $WA_keepQueryString = false;
    $WA_indexField = "id";
    $WA_fieldNamesStr =
    "sort|s_head|s_text|head|subhead|bodytext|photoid|photocaption|name|phone|email|linktitle |linkaddress|show_pfm|show_arch|show_cab";
    $WA_fieldValuesStr =
    "".((isset($_POST["sort"]))?$_POST["sort"]:"") ."" . "|" .
    "".((isset($_POST["s_head"]))?$_POST["s_head"]:"") ."" . "|" .
    "".((isset($_POST["s_text"]))?$_POST["s_text"]:"") ."" . "|" .
    "".((isset($_POST["head"]))?$_POST["head"]:"") ."" . "|" .
    "".((isset($_POST["subhead"]))?$_POST["subhead"]:"") ."" . "|" .
    "".((isset($_POST["bodytext"]))?$_POST["bodytext"]:"") ."" . "|" .
    "".((isset($_POST["photoid"]))?$_POST["photoid"]:"") ."" . "|" .
    "".((isset($_POST["photocaption"]))?$_POST["photocaption"]:"") .""
    . "|" . "".((isset($_POST["name"]))?$_POST["name"]:"") ."" . "|" .
    "".((isset($_POST["phone"]))?$_POST["phone"]:"") ."" . "|" .
    "".((isset($_POST["email"]))?$_POST["email"]:"") ."" . "|" .
    "".((isset($_POST["linktitle"]))?$_POST["linktitle"]:"") ."" . "|"
    . "".((isset($_POST["linkaddress"]))?$_POST["linkaddress"]:"") .""
    . "|" . "".((isset($_POST["show_pfm"]))?$_POST["show_pfm"]:"") .""
    . "|" . "".((isset($_POST["show_arch"]))?$_POST["show_arch"]:"")
    ."" . "|" . "".((isset($_POST["show_cab"]))?$_POST["show_cab"]:"")
    $WA_columnTypesStr =
    "none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',n one,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NUL L";
    $WA_fieldNames = explode("|", $WA_fieldNamesStr);
    $WA_fieldValues = explode("|", $WA_fieldValuesStr);
    $WA_columns = explode("|", $WA_columnTypesStr);
    $WA_connectionDB = $database_nm_connect;
    mysql_select_db($WA_connectionDB, $WA_connection);
    if (!session_id()) session_start();
    $insertParamsObj =
    WA_AB_generateInsertParams($WA_fieldNames, $WA_columns,
    $WA_fieldValues, -1);
    $WA_Sql = "INSERT INTO " . $WA_table . " (" .
    $insertParamsObj->WA_tableValues . ") VALUES (" .
    $insertParamsObj->WA_dbValues . ")";
    $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or
    die(mysql_error());
    $_SESSION[$WA_sessionName] = mysql_insert_id();
    if ($WA_redirectURL != "") {
    if ($WA_keepQueryString && $WA_redirectURL != ""
    && isset($_SERVER["QUERY_STRING"]) &&
    $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
    $WA_redirectURL .= ((strpos($WA_redirectURL, '?') ===
    false)?"?":"&").$_SERVER["QUERY_STRING"];
    header("Location: ".$WA_redirectURL);
    ?>

  • Any problem with a single MySQL database used on more than one site?

    I have a set of multiple sites hosted separately I'm working on. I'd like to set up a PHP/MySQL database on one site, and be able to pull data from it for completely separate sites. Seems like it shouldn't be a problem. Are there any problems with doing this I need to be aware of?

    I've set up databases on three different hosts, and in all cases I could access the databases from outside the domain of the site itslef.  GoDaddy is one of them, they used to restrict it, but now they give you the option when setting up a new database on your account.

  • Accesing mysql database from threads

    Hi
    dont know if this is the right place for this
    I'm building a server-client application, on sever's side I create a thread for every client who can request several operations over a mysql database (insert, delete, update, etc), at some point 2 clients can request the same operation over the same registry (2 clients trying to delete the same registry, for example), I try to avoid that to happend, so before doing any operation over the database I check the correct status (a registry must exist to delete, or not exist to create, for example), this is the code that makes that (for inserting a registry):
    //first I make sure the registry does not exist
    sql = "SELECT id_grupo FROM adm_grupo WHERE nombre_grupo = '" + nomGrupo + "'";
    res = bd.ConsultarSQL(sql);
    //If already exist, the operation is rejected
    if (res.next()) {
        EnviarError("Error al Crear el Grupo: Ya existe ese nombre");
         return -1;               
    //Check point ends
    //If not, the insert statement is made
    sql = "INSERT INTO adm_grupo VALUES (NULL,'" + nomGrupo + "','N')";however, since it could be 2 threads (every thread is an object) doing that, the first one can pass the check point and stop because its processor time is over, so the second can start its insert process and pass the check point too (because the first one didn't have enough time to insert the registry), then both registries are inserted causing a logical error, I thought in fixing that problem using the synchronized keyword for the functions, but I read that keyword blocks 1 object that can be accesed for several threads, but in my case I have several threads, everyone accesing its own object, so I'm not sure if the synchronized will work, I dont know any other solution to this,
    thnx in advance for any help

    Sure.  But test it.  You'll need to test it regardless, just to make sure it all works.
    In general, I usually prefer to have the backup tool create the initial SQL database archive on the primary server, zip it, and to then have the backup server in a trusted network location pull the database archive over to the backup server.  (It can then unzip it or process it as needed.)  With this, the primary server doesn't have access to the backups, nor to the backup server. This intended to isolate the access that a breach of the primary server might permit.

  • How to Insert a record into a MySql database.

    Hi,
    In an earlier question I was advised to use the Adobe extension to get access to database connectivity and server behaviours.
    That extension is now installed. Whether it is functional is another question.
    To chewck it out I follwed exactly the steps set out in Lessons 5 and 6 of Dreamweaver CS5 with PHP
    When trying to make a database connection I am still getting the 404 error I mentioned in an earlier email. However if I type the database name (phpcs5) into the “select database” box and test it says I connected successfully and I can see the user’s table in the database panel.
    So far apparently so good.
    I have created the cs5wtite and cs5read connections to the phpcs5 database
    I set up the insert record behaviour using “Form1!, “cs5write”, “users”,
    Everything went as per the manual, the file turned aqua in Live view.
    I entered data and ctrl/clicked “Sign me up” button and nothing happened.
    No data was entered into the database and I was not passed to login.php.
    I deleted everything from the computer, restarted the pc and started again from scratch.
    The result was the same. Nothing
    My one concern was line 49  $insertGoTo = " login.php";
    The file is in registration so I changed to $insertGoTo = "registration/login.php";
    but that made no difference.
    Is there any logging or error reporting I can use to see where it is going wrong?
    This is the add user page generated
    <?php require_once('../Connections/cs5write.php'); ?>
    <?php
    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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO users (first_name, family_name, username, password) VALUES (%s, %s, %s, %s)",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['surname'], "text"),
                           GetSQLValueString($_POST['username'], "text"),
                           GetSQLValueString($_POST['password'], "text"));
      mysql_select_db($database_cs5write, $cs5write);
      $Result1 = mysql_query($insertSQL, $cs5write) or die(mysql_error());
      $insertGoTo = "login.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>
    <!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>Add new user</title>
    <link href="../../styles/users.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <h1>Sign Up Now</h1>
    <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
      <fieldset>
        <legend>Just a few details and you&rsquo;re in</legend>
        <p>
          <label for="first_name">First name:</label>
          <input type="text" name="first_name" id="first_name" />
        </p>
        <p>
          <label for="surname">Family name:</label>
          <input type="text" name="surname" id="surname" />
        </p>
        <p>
          <label for="username">Username:</label>
          <input type="text" name="username" id="username" />
        </p>
        <p>
          <label for="password">Password:</label>
          <input type="password" name="password" id="password" />
        </p>
        <p>
          <label for="conf_password">Confirm password:</label>
          <input type="password" name="conf_password" id="conf_password" />
        </p>
        <p>
          <input type="submit" name="add_user" id="add_user" value="Sign me up!" />
        </p>
      </fieldset>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    </body>
    </html>
    This is the connection page
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_cs5write = "localhost";
    $database_cs5write = "phpcs5";
    $username_cs5write = "cs5write";
    $password_cs5write = "Smp??2014";
    $cs5write = mysql_pconnect($hostname_cs5write, $username_cs5write, $password_cs5write) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>
    I understand this solution is a wokraround Adobe privided whist deprecating its use.
    In the earlier question I asked if there was another way to work with a database. Someone posted a link to an Object orientated solution but It was way beyond my coding abilities. I wonder are there any other solutions out there?
    Thanks for any input

    Hi,
    Thanks for the test.
    I used your amendment but still got nothing, no record in database and not sent to login page..
    I also tried this code below. It returns "Record added to database" but it was not.
    Something strange going on.
    <?PHP
    $user_name = "cs5write";
    $password = "Smp??2014";
    $database = "phpcs5";
    $server = "127.0.0.1";
    $db_handle = mysql_connect($server, $user_name, $password);
    $db_found = mysql_select_db($database, $db_handle);
    if ($db_found) {
    $SQL = "INSERT INTO users (first_name, surame, username, password) VALUES) VALUES ('Albert', 'Dent', 'hitchiker', 'space')";
    $result = mysql_query($SQL);
    mysql_close($db_handle);
    print "Records added to the database";
    else {
    print "Database NOT Found ";
    mysql_close($db_handle);
    ?>

  • 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/

  • [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

  • Submitting Pdf form fields to a MySQL database via PhP

    Hi there,
    I have recently created a Pdf in Adobe LiveCycle which looks great, and I have added a submit button which is set up to send all the form data in HTML to a PhP file on the server side. The PhP file then collects the form data and inserts it into my MySQL database.
    When I run this form from Adobe reader or Professional it works great and the new record is inserted in the database. However I am trying to embed the form into a HTML page, which again looks fine, and all other buttons i.e. Save As, Print work fine.
    The submit button however is not working properly now. It inserts a new record into my database, but the fields are blank as if the form data has not been sent or received?
    Can you possibly advise me where i'm going wrong.
    Much appreciated
    Cane

    Hi Cane,
    I'm relatively new to creating Adobe Forms but I'm looking to do exactly what you have set up, submitting the results to php which sends the results to a database. I don't like the responses being sent to a pdf response file then every so often you have to export to csv then import the results into a database....too tedious. Can you perhaps provide the code that goes behind the submit button and maybe the code that you use on the php/server side? Again, relatively new to this and don't know where to begin but if I can look at the code behind this it would make things a lot easier.
    Thanks,
    Ed

  • PHP/mySQL Insert/Update Problems

    I hope someone can help because I can't find anything online
    that is helping me with this problem. I can't get the Dreamweaver
    controls to work when coding a PHP insert or update record page. It
    looks like it creates the code correctly but when I put them out on
    my webserver and then fill out the form and click submit the page
    submits and tries to use a URL string of (null)/admin/index.php
    where index.php is the form page not the page I told it to redirect
    to. I don't know why the (null) value keeps getting inserted into
    the string either. The browser obviously can't find this URL so
    gives a page cannot be displayed screen and nothing get's inserted
    or updated in the mySQL database.
    Any help would be greatly appreciated. This problem is
    driving me crazy because I want to save time not having to hand
    code things. Below is a User Authentication page using the
    Dreamweaver controls that does the same thing when I try to
    login.

    tobyd wrote:
    > the page submits and tries to use a URL string of
    (null)/admin/index.php
    > where index.php is the form page not the page I told it
    to redirect to. I don't
    > know why the (null) value keeps getting inserted into
    the string either.
    The following two lines set the URL for login success and
    failure.
    > $MM_redirectLoginSuccess = "../admin_index.php";
    > $MM_redirectLoginFailed = "../admin/index.php";
    As you can see, they are relative paths, suggesting that the
    login form
    is in a different subfolder, but at the same level as
    admin_index.php
    and the admin folder. The (null) almost certainly comes from
    the fact
    that your login page is in the site root. If you're typing in
    the
    redirect filenames manually, use the Browse button instead.
    Dreamweaver
    should set the correct path for you.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • I cant my insert to work in php mysql?!?!?!?

    I been working on this for some days. I cant get my insert to add these a record from user input into my mysql database
    this is my validation.php
    this is my insert.php
    why is it not working

    //validation.php
    <html>
    <head>
    <link href="css/styles2.css" rel="stylesheet" type="text/css" media="screen">
    </head>
    <body background="images/swirl.jpeg">
    <?php
    $NameofOrganization = $_GET['NameofOrganization'];
    $Tickets = $_GET['Tickets'];
    $OriginalPrice = $_GET['originalprice'];
    $DiscountedPrice = $_GET['DiscountedPrice'];
    $Date = $_GET['Date'];
    $Time = $_GET['Time'];
    $Email = $_GET['Email'];
    $Description = $_GET['Description'];
    $Event_name = $_GET['event_name'];
    $to = $Email;
    $subject = "Statesboro Ticket Bank Confirmation";
    $body = " Thank You " . $NameofOrganization . ". You have posted " . $Tickets . " tickets to the Statesboro Ticket Bank at a discounted price of $ " . $DiscountedPrice. "Thank You";
    $from = "[email protected]";
    ?>
    <div id = "Validationwrapper">
    <h1> Are you sure the Information is correct ? </h1>
            <form action= "insert.php" method="get">
                <ol>
                   <li>
                       <label for="Name of Organization"> Name of Organization</label>
                        <input name="NameofOrganization" type="text" id="NameofOrganization" value="<?php echo htmlentities($NameofOrganization); ?>"  readonly="true" />
                   </li>
                   <li>
                   <label for="Name of Event"> Event Name</label>
                        <input name="event_name" type="text" id="event_name" value="<?php echo htmlentities($Event_name); ?>"  readonly="true" />
                   </li>
                   <li>
                       <label for="Tickets"> Number of Tickets being deposited</label>
                    <input name="Tickets" type="text" id="Tickets" name="Tickets" value="<?php echo htmlentities($Tickets); ?>"  readonly="true"/>
                   </li>
                   <li>
                    <label for="orginalprice"> Original Price of the Tickets $</label>
                    <input name="originalprice"  type="text" id="originalprice" name="originalprice" value="<?php echo htmlentities($OriginalPrice); ?>"  readonly="true"/  >
                  </li>
                   <li>
                       <label for="DiscountedPrice"> Discounted Price for Approved Agencies</label>
                    $<input name="DiscountedPrice" type="text" id="DiscountedPrice" name="DiscountedPrice" value="<?php echo htmlentities($DiscountedPrice); ?>"  readonly="true"/  >
                    <li>
                       <label for="Date"> Date of the Event</label>
                    <input name="Date" type="text" id="Date" name ="Date" value="<?php echo htmlentities($NameofOrganization); ?>"  readonly="true"/  >
                    </li>
                    <li>
                       <label for="Time"> Time</label>
                    <input name="Time" type="text" id="Time" name="Time" value="<?php echo htmlentities($Time); ?>"  readonly="true"/ >
                   </li>
                  <li>
                       <label for="Email"> Provide an Email we can Contact you </label>
                    <input name="Email" type= "text" id="Email" name"Email" value="<?php echo htmlentities($Email); ?>"  readonly="true"/ >
                  <li>
                   <label for= " Description"> Description</label>
                   <input name= "Description" id="Description" name="Description" style="width:300px" value="<?php echo htmlentities($Description); ?>"  readonly="true"/ >
                   </li>
                   <li>
                       <input name type="submit" class ="submit" name="submit" value="submit" >
                   </li>
                </ol>
                </form>
                </div>
                <div>
                <a href="VEventForm.php">Go Back </a>
                </div>
    </body>
    </html>

Maybe you are looking for

  • Unable to launch forms after upgrade from 12.1.1 to 12.1.3

    APP-FND-01496 CANNOT ACCESS APPLICATION ORACLE PASSWORD.

  • Satellite C855-1CH - cannot control brightness after closing / opening lid

    hello i have a problem with windows 7 64 and amd 7610m driver, when i install the driver from toshiba site, have problem with hibernate, When i closed lid and unplugged ac adapter and after few minutes/hours i turn on the computer the brightness is s

  • Update statement help

    Hello folks, I need some help/advise on an UPDATE statement. I have two tables. I need to join these tables and update a field in table1 with a field from table2. Please see the attached jpg file. The first 3 coloumns are from table1 and last 2 colum

  • Using setx.exe while using PowerShell Remoting

    Hi, I am using the Invoke-Command with a Session to execute some installers on a remote computer. This works fine but for some reason setx.exe (to set Environment Variables) will not work as expected. When I create a new computer Environment Variable

  • Help, I am trying to download the compiler for windows,

    I need to be able to run Java Programs for a class I am starting soon and I know I need the compiler, but every attempt to get it has failed. And to tell the truth I am not really sure what I need to download. Can anyone help me? I joined SDN. Now wh