Dynamic Population of Fields Stopped Working

Home Forums Quform WordPress Dynamic Population of Fields Stopped Working

This topic is: not resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5786
    lawrencepepper
    Participant

    Hello, not sure what has happened but I am pulling my hair out trying to fix this. I have a form that was being populated by a query from data in my WordPress database. It has been working fine then all of a sudden it stopped populating the fields. Sometimes one or two populate, other times none. Nothing has changed with the code.

    The code for the page:


    <?php

    $rnumber = $_SESSION['iphorm_10']['iphorm_10_3'];

    $con = mysql_connect("localhost","user","password");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("edata", $con);

    $result = mysql_query("SELECT * FROM part_record WHERE record_number = '$rnumber'");
    while($row = mysql_fetch_assoc($result)) { global $fname; $fname = $row['file']; } ?>

    <?php

    echo "<h4>Part Number: " . $rnumber . "</h4>";

    $con = mysql_connect("localhost","user","password");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("edata", $con);

    $result = mysql_query("SELECT * FROM part_record WHERE record_number = '$rnumber'");

    ?>

    <?php

    if (mysql_num_rows($result)==0) {
    echo "[warning_box]The part number " . $rnumber . " does not exist. Please try again.[/warning_box]
    ";

    }
    else {
    while($row = mysql_fetch_assoc($result)) {?>

    [iphorm id=9 name="Update Part" values="current_description=<? echo $row['description']; ?>&current_detailed=<? echo $row['detailed_description']; ?>&current_notes=<? echo $row['notes']; ?>&current_rnumber=<? echo $rnumber; ?>&current_manufacturer=<? echo $row['manufacturer']; ?>&current_mnumber=<? echo $row['manufacturer_number']; ?>&current_altmanufacturer=<? echo $row['alt_manufacturer']; ?>&current_altnumber=<? echo $row['alt_number']; ?>&current_file=<? echo $row['file']; ?>&current_file_description=<? echo $row['file_description']; ?>"]

    <?php
    }

    }?>

    I know the record number is being passed and is correct as it displays the number properly, and also does show a populated field randomly.

    Any ideas?

    #5793
    lawrencepepper
    Participant

    OK,

    Figured this out, this has been happening for awhile we just never noticed since the update function of the app was not used often,

    BUT

    Anytime there is a quote mark (“) in a field it breaks the population of the fields.

    We have a couple description fields where quote marks are being used for inches. i.e.: 1.5″ long and 4.5” wide.

    How can I fix this so that text fields that have had quote marks put into them do not break the dynamic population? Guessing this has to do with the query to grab the data?

    Any help would be appreciated.

    Thanks!

    #5800
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy