Commit c77179f5 authored by Gabriel Moreau's avatar Gabriel Moreau
Browse files

Add set_supplier_new function

parent a990539a
......@@ -438,6 +438,18 @@ function get_supplier_find($pdo, $find='') {
// ---------------------------------------------------------------------
function set_supplier_new($pdo, $name, $address, $tel, $fax, $email, $www, $contact, $description) {
$sql = 'INSERT INTO fournisseurs (nom, adresse, mail, www, tel, fax, contact, descr) VALUES (?, ?, ?, ?, ?, ?, ?, ?)';
$stmt = $pdo->prepare($sql);
$status = $stmt->execute(array($name, $address, $tel, $fax, $email, $www, $contact, $description));
$err_msg = '';
if (!$status)
$err_msg = $stmt->errorInfo()[2];
return array($pdo->lastInsertId(), $err_msg);
}
// ---------------------------------------------------------------------
function set_supplier_update($pdo, $id_supplier, $name, $address, $tel, $fax, $email, $www, $contact, $description) {
$sql = 'UPDATE LOW_PRIORITY fournisseurs SET nom = ?, adresse = ?, tel = ?, fax = ?, mail = ?, www = ?, contact = ?, descr = ? WHERE 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