Giải pháp thiết kế web động với PHP - p 48
43
lượt xem 5
download
lượt xem 5
download

Giải pháp thiết kế web động với PHP - p 48
Mô tả tài liệu

MANAGING MULTIPLE DATABASE TABLES } else { $sql = 'UPDATE blog SET image_id = NULL, title = ?, article = ? WHERE article_id = ?'; $stmt-prepare($sql); $stmt-bind_param('ssi', $_POST['title'], $_POST['article'], $_POST['article_id']); } $stmt-execute(); $done = $stmt-affected_rows; } The last two lines of this code block execute the prepared statement that updates the record in the blog table, and then assign the number of affected rows to $done. If you update a record, the affected_rows property is 1, which is treated as true. However, if you don t make any changes to the record, affected_rows is 0, which is treated as false. If...
Chủ đề:
Bình luận(0) Đăng nhập để gửi bình luận!

CÓ THỂ BẠN MUỐN DOWNLOAD