From 1f349891443a1eb5bd1b69b464fc7844f5caf123 Mon Sep 17 00:00:00 2001 From: Thomas Rubini <74205383+ThomasRubini@users.noreply.github.com> Date: Tue, 17 Jan 2023 09:51:16 +0100 Subject: [PATCH] replace NAME with USERNAME in recipe view --- Models/RecipeModel.php | 2 +- Models/UserModel.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Models/RecipeModel.php b/Models/RecipeModel.php index 1b0ca1f..eab85b3 100644 --- a/Models/RecipeModel.php +++ b/Models/RecipeModel.php @@ -25,7 +25,7 @@ final class RecipeModel $A_recipe["INGREDIENTS"] = $O_ingredientModel->searchByRecipe($A_recipe["ID"]); $O_userModel = new UserModel(); - $A_recipe["AUTHOR_NAME"] = $O_userModel->getNameByID($A_recipe["AUTHOR_ID"]); + $A_recipe["AUTHOR_USERNAME"] = $O_userModel->getUsernameByID($A_recipe["AUTHOR_ID"]); $O_userModel = new DifficultyModel(); $A_recipe["DIFFICULTY_NAME"] = $O_userModel->getByID($A_recipe["DIFFICULTY_ID"]); diff --git a/Models/UserModel.php b/Models/UserModel.php index f0cc10a..d777c11 100644 --- a/Models/UserModel.php +++ b/Models/UserModel.php @@ -46,10 +46,10 @@ final class UserModel return $row; } - public function getNameByID($I_id) + public function getUsernameByID($I_id) { $O_model = Model::get(); - $stmt = $O_model->prepare("SELECT NAME FROM USER WHERE ID=:id"); + $stmt = $O_model->prepare("SELECT USERNAME FROM USER WHERE ID=:id"); $stmt->bindParam("id", $I_id); $stmt->execute();