안효원 안효원 2022-01-28
CRUD complete
@28269a7d1a3a504f64a566963d3d1033ea2f5d9e
20220126/Address.php
--- 20220126/Address.php
+++ 20220126/Address.php
@@ -37,7 +37,7 @@
     public function updateTest($no, $name, $age, $tel, $area, $birth) {
         try {
             $stmt = $this->db->prepare("update address set name=?, age=?, tel=?, area=?, birth=? where no=?");
-            $stmt->execute(array($no));
+            $stmt->execute(array($name, $age, $tel, $area, $birth, $no));
             return true;
         }catch (PDOException $e) {
             echo $e;
20220126/address_update_front.php
--- 20220126/address_update_front.php
+++ 20220126/address_update_front.php
@@ -32,7 +32,8 @@
         <label for="birth">
             생년월일 : <input type="date" name="birth">
         </label>
-        <button type="submit">수정</button>
+        <br><button type="submit">수정</button>
     </form>
+    <button onclick="document.location.href='address_view.php'">취소</button>
 </body>
 </html>
(No newline at end of file)
Add a comment
List