<!doctype html>
<html lang="tr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>Database Manager</title>
</head>
<body>
<div class="col-md-12 row justify-content-center" style="padding-top: 100px;">
<div class="row justify-content-center">
<div class="col-md-2 text-center">
<form action="index.php" method="post">
<label>Çekilecek Kişi Sayısı</label>
<input type="number" name="pst-Limit" class="form-control" name="" value="<?= isset($_POST['pst-Limit']) ? $_POST['pst-Limit'] : '15' ?>">
<br>
<button type="submit" name="pst-SubmitData" class="btn btn-outline-success w-8">Verileri Çek</button>
</form>
</div>
</div>
</div>
<br>
<br>
<div class="col-md-12 row justify-content-center">
<div class="col col-md-6 text-center justify-content-center">
<?php
if (isset($_POST['pst-SubmitData']) and isset($_POST['pst-Limit'])) {
$conn = new mysqli('localhost', "root", "", "mytestdb");
$Limit = $_POST['pst-Limit'];
$select = "SELECT * FROM bilgiler LIMIT $Limit";
$result = $conn->query($select);
$table = "<table class='table'>
<thead>
<th scope='col'>#</th>
<th scope='col'>Ad</th>
<th scope='col'>Soyad</th>
</thead>
<tbody>
";
if ($result->num_rows > 0) {
$count = 0;
while ($select = $result->fetch_assoc()) {
$name = $select['adi'];
$surname = $select['soyadi'];
$table .= "
<tr>
<th scope='row'>$count</th>
<td>$name</td>
<td>$surname</td>
</tr>
";
$count++;
}
$table .= '</tbody></table>';
echo $table;
} else {
echo "not found.";
$table = "";
}
} else {
echo "Bir değer giriniz.";
}
?>
</div>
</div>
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> -->
</body>
</html>