Hi guys!
I've tried to insert data inside an input's value but the input goes like it is hidden, When I inspect the page it shows that there is no input inside my form. I've tried to move the code to the top of page but nothing is changed always a hidden input while it is not hidden at all as you can see below:
<div class="mb-3">
<?php
//Checking if submit button is clicked
if (isset($_POST['submit'])) {
//database cn
$db = new PDO("mysql:host=localhost;dbname=centrify","root","");
$username = $_POST['user'];
$stmt = $db->prepare("SELECT * FROM agencies_data WHERE agency_user = ".$username."");
$stmt->execute();
?>
<input class="form-control" type="text" name="oid" value="<?php while($item = $stmt->fetch()) { echo $item['agency_user']; } ?>"> <?php } ?>
</div>
I've tested a lot of placements but it doesnt work for me.