updateform.php

updateform.php

QA

updateform.php

본문

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>
답변을 작성하시기 전에 로그인 해주세요.
전체 116
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT