I am getting this error, i make sure all names are correct and idk what's wrong, seems like nothing is added in rsn column. Been searching around and i know issue but i don't know what is causing my issue and if you can comment my code if it's injectable, first time using PDO.
html
<form action="rsdenar.php" method="post">
<div id="gold-calc">
<div class="col-md-4">
<label for="amount"><h3><i class="fa fa-database"> Kolicina</i></h3></label>
<input type="text" class="form-control" id="amount" name="gpamount">
</div>
<div class="col-md-4">
<select class="form-control" style="margin-top:30px; width: 70%;" id="goldtype">
<option value="0.5">RS3</option>
<option value="1.6">RS 07</option>
</select>
</div>
<div class="col-md-4">
<label for="price"><h3><i class="fa fa-database"> Cena</i></h3></label>
<input type="text" class="form-control" id="price">
</div>
<div class="row" style="padding-top: 170px;">
<label for="idrsn">RSN: </label>
<input type="text" class="form-control" id="idrsn" name="rsn" style="width: 40%">
</div>
<div class="row">
<label for="emailbuy">Email: </label>
<input type="text" class="form-control" id="emailbuy" name="email-nakup" style="width: 40%;">
</div>
<div class="buy-order">
<button type="submit" class="btn btn-primary"><a style="text-decoration: none" href="#"><h5 style="font-family: arial; font-size: 20px">NAKUP</h5></a></button>
</div>
</div>
</form>
php
<?php
include 'php_includes/db_connect.php';
try {
$stmt=$conn->prepare("INSERT INTO purchase (rsn,email,amount,unique_id)
VALUES (:rsn, :email, :amount, :unique_id)");
$stmt->bindParam(':rsn', $_POST['rsn']);
$stmt->bindParam(':email', $_POST['email-nakup']);
$stmt->bindParam(':amount', $_POST['gpamount']);
$stmt->bindParam(':unique_id', $_POST['unique_id']);
$stmt->execute();
}catch (exception $e){
echo $e;
}
?>
sql
$_POST['unique_id']
– Jay Blanchard