/
golost
/
QaManagerBotBackend
Обзор
Документация
Войти
/
golost
/
QaManagerBotBackend
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
app1/api/user/update.php
37 строк
858 B
olegnizh
Добавьте файлы проекта.
05 июн 2024, 16:06
05 июн 2024, 16:06
8ef4523
Код
Авторство
О чём код?
<?php // include database and object files include_once '../config/database.php'; include_once '../objects/doctor.php'; // get database connection $database = new Database(); $db = $database->getConnection(); // prepare doctor object $doctor = new Doctor($db); // set doctor property values $doctor->id = $_POST['id']; $doctor->name = $_POST['name']; $doctor->email = $_POST['email']; $doctor->password = base64_encode($_POST['password']); $doctor->phone = $_POST['phone']; $doctor->gender = $_POST['gender']; $doctor->specialist = $_POST['specialist']; // create the doctor if($doctor->update()){ $doctor_arr=array( "status" => true, "message" => "Successfully Updated!" ); } else{ $doctor_arr=array( "status" => false, "message" => "Email already exists!" ); } print_r(json_encode($doctor_arr)); ?>