Edit button undefined table id
I have this code for an edit button:
<form method="post" action="pengiriman-input.php">
<input type="hidden" name="id" value="<?php echo $row['id_transaksi']; ?>" />
<input type="submit" value="Kirim" />
</form>
and in pengiriman-input.php
<?php
session_start();
$_SESSION['id_transaksi'] = $_POST['idtransaksi']; ?>
but the result is:
Undefined index: idtransaksi in> C: \ xampp \ htdocs \ delivery \ pengiriman-input.php
How do I name the value $row['idtransaksi']
for pengiriman-input.php
?
$row['idtransaksi']
is a MySQL query.
source to share
Set up in the column name
as in your attribute name
it name='id'
, notidtransaksi
$_SESSION['id_transaksi'] = $_POST['idtransaksi'];
^^^^^^^^^^^
It should be
$_SESSION['id_transaksi'] = $_POST['id'];
^^^
or you can check it with either PHP isset function
$_SESSION['id_transaksi'] = (isset($_POST['id'])) ? $_POST['id'] : 0;
source to share