Advertisement
Ruthp

Untitled

Sep 22nd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. function AddProduct($pname, $packtype, $recomprice, $fmlycode)
  2. {
  3. global $db;
  4. $cmd_add_product = "INSERT INTO products (Pname, PackType, RecomPrice, fmlyCode) VALUES (:pname, :packtype, :recomprice, :fmlycode);";
  5. try
  6. {
  7. $qry = $db-> prepare($cmd_add_product);
  8. $qry -> bindValue(':pname', $pname);
  9. $qry -> bindValue(':packtype', $packtype);
  10. $qry -> bindValue(':recomprice', $recomprice);
  11. $qry -> bindValue(':fmlycode', $fmlycode);
  12. $qry -> execute();
  13.  
  14. $result = $qry -> fetch();
  15. return $result;
  16.  
  17. }
  18. catch (PDOException $ex)
  19. {
  20. echo "There was a problem add the product".$ex->GetMessage();
  21. exit;
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement