Commit e8bfa917 authored by Estéban Ristich's avatar Estéban Ristich
Browse files

Fix Issue #62 Add SQL function get recipe all by id

parent a5546959
......@@ -1495,6 +1495,18 @@ function del_recipe_by_id($pdo, $id) {
// ---------------------------------------------------------------------
function get_recipe_all_by_id($pdo, $id) {
$sql = 'SELECT * FROM recipe WHERE id = ?;' ;
$stmt = $pdo->prepare($sql);
$stmt->execute(array($id));
$result_fetch = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (count($result_fetch) > 0)
return $result_fetch[0];
return false;
}
// ---------------------------------------------------------------------
function get_recipe_listall_by_equipment($pdo, $equipment_id) {
$sql = 'SELECT * FROM recipe WHERE equipment_id = ?;' ;
$stmt = $pdo->prepare($sql);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment