I took a bd field capture and give this error

-1

After I put this code below ....

         $capturaValorTotal = $_POST['valor'];
         $capturaValorPagar = $_POST['valor-pagar'];

         $valorDevido = $capturaValorTotal - $capturaValorPagar;

         $inserindoBanco = "INSERT INTO 'clientes' ('saldoDevedor') VALUES ('".$valorDevido."')";

         $executandoQuery = mysql_query($inserindoBanco);

These errors occurred below ...

  

A PHP Error was encountered

Severity: Notice

Message: Undefined index: pay-value

Filename: controllers / financier.php

Line Number: 355 A PHP Error was encountered

Severity: Warning

Message: Can not modify header information - already started by /

Filename: libraries / Session.php

Line Number: 675 A PHP Error was encountered

Severity: Warning

Message: Can not modify header information - already started by /

Filename: helpers / url_helper.php

Line Number: 542

Remembering that it is a system made in codeigniter, with OOP. All fields mentioned above have been entered into the database. In Models I made the select of the fields that I need (if they need, I put here also the Models.)

My intention is just to make a change in the system, so that when the user receives part of a payment, the system registers the "missing" field in the Debtor balance of the client table.

I hope I was able to explain my doubt.

    
asked by anonymous 09.09.2016 / 23:18

1 answer

1

I see some problems there

1) Exchange your insert line for this

$inserindoBanco = "INSERT INTO 'clientes' set 'saldoDevedor'='".valorDevido."'";

2) pay-per-value is not set

3) You are doing some information output before some header or setting 2 headers on the same page. It would be interesting to make the whole code available for verification.

    
09.09.2016 / 23:21