change SQL parameter to descr

This commit is contained in:
Thomas Rubini 2023-01-25 20:18:40 +01:00
parent 87252f0ed7
commit d2c5fbcbde
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -30,11 +30,11 @@ final class RecipeModel
public function insert()
{
$O_model = Model::get();
$stmt = $O_model->prepare("INSERT INTO RECIPE (NAME, TIME, COST, DESCR, RECIPE ,DIFFICULTY_ID, AUTHOR_ID) VALUES(:name, :time, :cost, :desc, :recipe, :difficulty_id, :author_id)");
$stmt = $O_model->prepare("INSERT INTO RECIPE (NAME, TIME, COST, DESCR, RECIPE ,DIFFICULTY_ID, AUTHOR_ID) VALUES(:name, :time, :cost, :descr, :recipe, :difficulty_id, :author_id)");
$stmt->bindParam("name", $this->S_NAME);
$stmt->bindParam("time", $this->I_TIME);
$stmt->bindParam("cost", $this->I_COST);
$stmt->bindParam("desc", $this->S_DESCR);
$stmt->bindParam("descr", $this->S_DESCR);
$stmt->bindParam("recipe", $this->S_RECIPE);
$stmt->bindParam("difficulty_id", $this->I_DIFFICULTY_ID);
$stmt->bindParam("author_id", $this->I_AUTHOR_ID);
@ -44,12 +44,12 @@ final class RecipeModel
public function update()
{
$O_model = Model::get();
$stmt = $O_model->prepare("UPDATE RECIPE SET NAME=:name, TIME=:time, COST=:cost, DESCR=:desc, RECIPE:recipe, DIFFICULTY_ID=:difficulty_id, AUTHOR_ID=:author_id WHERE ID=:id");
$stmt = $O_model->prepare("UPDATE RECIPE SET NAME=:name, TIME=:time, COST=:cost, DESCR=:descr, RECIPE:recipe, DIFFICULTY_ID=:difficulty_id, AUTHOR_ID=:author_id WHERE ID=:id");
$stmt->bindParam("id", $this->I_ID);
$stmt->bindParam("name", $this->S_NAME);
$stmt->bindParam("time", $this->I_TIME);
$stmt->bindParam("cost", $this->I_COST);
$stmt->bindParam("desc", $this->S_DESCR);
$stmt->bindParam("descr", $this->S_DESCR);
$stmt->bindParam("recipe", $this->S_RECIPE);
$stmt->bindParam("difficulty_id", $this->I_DIFFICULTY_ID);
$stmt->bindParam("author_id", $this->I_AUTHOR_ID);