안녕하세요, 내 데이터베이스의 일부 테이블 행을 업데이트해야하지만 내 PHP 기능에 아무런 오류가 없으며 아무런 업데이트도이 문제를 해결하는 데 도움이되지 않습니다.OOPHP를 사용하여 Mysqli 테이블을 업데이트하는 방법
내 표는 USER_ACCOUNT 전화를 다른 테이블, 계정의 FK, 주소
이 클래스를 지원하는 모든 기능을이다 다음 열, ID, USER_ID있다. Dbhandler.php
public function create_account($user_id, $account, $address) {
$stmt = $this->conn->prepare("UPDATE user_account set account= ?, address= ? where user_id = ? ");
$stmt->bind_param("iss", $user_id, $account, $address);
$stmt->execute();
}
**This file calls create_account function when i submit**
<?php
include './DbHandler.php';
$db = new DbHandler();
$response = array();
if ( isset($_POST['user_id']) && (isset($_POST['account']) && isset($_POST['address']) )!= '') {
$user_id = $_POST['user_id'];
$account = $_POST['account'];
$address = $_POST['address'];
$res = $db->createProfile($user_id, $account, $address);
}
?>
$ db-> createProfile 대신 $ db-> createAccount가되어야한다고 생각합니다. 응답을위한 두 개의 변수가 있습니다 : $ response 및 $ res, 하나만 사용하십시오 –
예, $ db-> createProfile을 $ db-> createAccount로 변경하고 $ res를 $ response로 변경했지만 변경하지 마십시오 –
우리에게 보여줄 수 있습니까? 출력 오류를 제발? –