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
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to update form data but getting an extra row
#1
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 ?>
  Reply


Messages In This Thread
Trying to update form data but getting an extra row - by ohiggins - 11-22-2018, 09:43 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)