<?php
try { $db = new PDO("mysql:host=localhost;dbname=test", "root", "123456"); } catch ( PDOException $e ){ print $e->getMessage(); }
if(isset($POST['paraekle']))
{
$query = $db->prepare("INSERT INTO tablo SET
sutun = ?");
$insert = $query->execute(array(
$paramiktari
));
if ( $insert ){
$last_id = $db->lastInsertId();
print "insert işlemi başarılı!";
}
}
?><form action="" method="POST">
<input type="number" name="paraekle" step="0.01" id="paraekle">
<button type="submit"> Ekle </form>
php de form datasını `$POST` şeklinde almıyoruz. `$_POST` veya `$_GET` ile alabiliyoruz.
https://www.w3schools.com/php/php_forms.asp https://www.php.net/manual/tr/reserv...ables.post.php https://www.php.net/manual/tr/reserv...iables.get.php
input'a name attribute verdiğiniz taktirde ve form tag'i içerisinde olduğu taktirde input name attribute value'sine göre form datasını php ile alabilirsiniz.