Merge pull request #9 from ThomasRubini/recipe_view_username

This commit is contained in:
Thomas Rubini 2023-01-17 09:51:34 +01:00 committed by GitHub
commit d60d0891de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ final class RecipeModel
$A_recipe["INGREDIENTS"] = $O_ingredientModel->searchByRecipe($A_recipe["ID"]); $A_recipe["INGREDIENTS"] = $O_ingredientModel->searchByRecipe($A_recipe["ID"]);
$O_userModel = new UserModel(); $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(); $O_userModel = new DifficultyModel();
$A_recipe["DIFFICULTY_NAME"] = $O_userModel->getByID($A_recipe["DIFFICULTY_ID"]); $A_recipe["DIFFICULTY_NAME"] = $O_userModel->getByID($A_recipe["DIFFICULTY_ID"]);

View File

@ -46,10 +46,10 @@ final class UserModel
return $row; return $row;
} }
public function getNameByID($I_id) public function getUsernameByID($I_id)
{ {
$O_model = Model::get(); $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->bindParam("id", $I_id);
$stmt->execute(); $stmt->execute();