<?php
$servername = "localhost";
$username = "root";
$password = '';
$dbname = "db_code";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT Otp FROM otptable";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "Otp: " . $row["Otp"] ."<br>";
x = " . $row["Otp"] .";
}
}
?>
<body>
<div id="floating-panel">
<input id="latlng" type="text" value="<?php echo $row["otp"]?>">
</body>
data is not coming in value field but working in above echo.
How to insert in value??
Can i store that $row["otp"] in a variable and then echo it in value tag. if yes then how?