public function Update($id, $data) { $userDAO = new UserDAO(); return $userDAO->Update($id, $data); }
public function Update() { if (!parent::Update()) { return false; } $conn = parent::GetConnection(); $this->RetrieveUserId(); $query = $this->SetupQuery(Query::UPDATE_PATIENT); if (!odbc_exec($conn, $query)) { return $this->HandleError($conn); } return true; }
//UserDAO DB fields $Username = $_POST["username"]; $Password = $_POST["password"]; $FirstName = $_POST["firstname"]; $MiddleName = $_POST["middlename"]; $LastName = $_POST["lastname"]; $Address = $_POST["address"]; $PhoneNumber = $_POST["phone"]; $UserClass = "Clinician"; $u = new UserDAO(); $u->Username = $Username; $u->Password = $Password; $u->FirstName = $FirstName; $u->MiddleName = $MiddleName; $u->LastName = $LastName; $u->Address = $Address; $u->PhoneNumber = $PhoneNumber; $u->UserClass = $UserClass; $u->Update(); header("Location: clinicians.php"); /* $worked = $p->Insert(); if ($worked) { header("Location: homepage.php?success=101"); } else { header("Location: add_patient.php?error=101"); } */