updateform.php

updateform.php

QA

updateform.php

답변 2

본문

updateform php 소스 좀 구해줘세요

이 질문에 댓글 쓰기 :

답변 2

<?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, firstname, lastname FROM MyGuests"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "0 results"; } $conn->close(); ?> <form action="update.php" method="post"> <div class="form-group"> <label for="id">ID:</label> <input type="text" class="form-control" id="id" name="id"> </div> <div class="form-group"> <label for="firstname">First Name:</label> <input type="text" class="form-control" id="firstname" name="firstname"> </div> <div class="form-group"> <label for="lastname">Last Name:</label> <input type="text" class="form-control" id="lastname" name="lastname"> </div> <button type="submit" class="btn btn-primary">Submit</button> </form>
<html> <head> <title>Update Form</title> </head> <body> <form action="update.php" method="post"> <label for="name">Name:</label> <input type="text" name="name" /><br /> <label for="email">Email:</label> <input type="text" name="email" /><br /> <label for="phone">Phone:</label> <input type="text" name="phone" /><br /> <input type="submit" value="Update" /> </form> </body> </html>
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 127
© SIRSOFT
현재 페이지 제일 처음으로