Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
legi
soft
gestex
Commits
c77179f5
Commit
c77179f5
authored
Oct 10, 2020
by
Gabriel Moreau
Browse files
Add set_supplier_new function
parent
a990539a
Changes
1
Hide whitespace changes
Inline
Side-by-side
module/db-functions.php
View file @
c77179f5
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment