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

Fix Issue #62 SQL function set new recipe

parent a131cd69
......@@ -1408,4 +1408,18 @@ function set_version_by_name($pdo, $name, $version) {
$stmt->execute(array($name, $version));
}
// ---------------------------------------------------------------------
// RECIPE
// ---------------------------------------------------------------------
function set_new_recipe($pdo, $pathname, $intervention_id) {
$sql = 'INSERT INTO recipe (pathname, intervention_id) VALUES (?, ?)';
$stmt = $pdo->prepare($sql);
$iostat = $stmt->execute(array($pathname, $intervention_id));
$err_msg = '';
if (!$iostat)
$err_msg = $stmt->errorInfo()[2];
return array($pdo->lastInsertId(), $err_msg);
}
?>
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