php - Getting a database output to show up in an input field -


i'm looking able outputted data database appear input box, have ability update data later on. trying echo output input field, displays under input field. how this?

<?php $con = mysqli_connect("localhost", "root", "", "db"); if (mysqli_connect_errno()) {     printf("connect failed: %s\n", mysqli_connect_error());     exit(); } $stmt = mysqli_query($con,"select * user_players"); while($row = mysqli_fetch_array($stmt)) {     $player1 = $row['player1'];     $player2 = $row['player2'];     $player3 = $row['player3'];     $player4 = $row['player4'];     $player5 = $row['player5'];     $player6 = $row['player6']; ?>     <div class="draftresultswrap">         <div class="inline">         <?php echo "<div>" . $row['firstname'] . " " . $row['lastname'] . "</div>"; ?>         </div>         <input class="draftborder"><?php echo $player1; ?></input> 

echo php value inside html input value

 <input class="draftborder" value='<?php echo $player1; ?>'/> 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -