The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Trying to update form data but getting an extra row - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Trying to update form data but getting an extra row (/showthread.php?tid=1240)



Trying to update form data but getting an extra row - ohiggins - 11-22-2018

Hi,

I'm trying to use the update function with the forms with the following code. I get the data in the form fine but when I go to save it I get a new row in the table and the original remains the same. Any ideas what I have done wrong?

Code:
<?php
require_once 'init.php';
require_once $abs_us_root.$us_url_root.'users/includes/header.php';
require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
if(!empty($_POST)){
$response = preProcessForm();
if($response['form_valid'] == true){
//do something here after the form has been validated
$response['fields']['user_id']=$user->data()->id;
$response = postProcessForm($response);
}
}
?>

<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
<?php
?>
<div id="page-wrapper">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                    <?php
                    $usFormUpdate = 6; //The row you want to update
                    $options['update'] = $usFormUpdate;
                    //then call your form with
                    displayform('session',['update'=>6]);
                         ?><p></p>
            </div> <!-- /.col -->
        </div> <!-- /.row -->
    </div> <!-- /.container -->
</div> <!-- /.wrapper -->


    <!-- footers -->
<?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>

<!-- Place any per-page javascript here -->

<?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>



RE: Trying to update form data but getting an extra row - mudmin - 11-23-2018

I'm out of town at the moment. I'm going to be doing a lot of work on the form builder. I will try to replicate your situation,if not. I may ask you to send me your form files and I should be able to get to it in a few days.  Sorry for the delay. It's a long trip from china.


RE: Trying to update form data but getting an extra row - ohiggins - 12-03-2018

(11-23-2018, 12:22 AM)mudmin Wrote: I'm out of town at the moment. I'm going to be doing a lot of work on the form builder. I will try to replicate your situation,if not. I may ask you to send me your form files and I should be able to get to it in a few days.  Sorry for the delay. It's a long trip from china.

Sorry only just got my laptop back from repair. Happy to send anything you want/need.


RE: Trying to update form data but getting an extra row - Cameron Smith - 12-31-2018

I'm also having this issue, but assumed it was just my scripting as this is all a little new.


RE: Trying to update form data but getting an extra row - mudmin - 12-31-2018

Can you share your script?