Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. function createMedOne() {
  2. $medid = "1";
  3. $mname = "Name1";
  4. $menh = "Amount 1";
  5. $mtime = "17:23";
  6. $mdte = date("Y-m-d");
  7. $mhtml = '<tr class="" id="med1">
  8. <td><p style="font-weight: bold;">Name1</p></td>
  9. <td>Amount 1</td>
  10. <td>Kl: 17:23</td>
  11. <td><button type="button" class="btn btn-warning btn-sm" style="float: right;">Sign</button></td>
  12. </tr>';
  13.  
  14. addmed($medid,$mname,$menh,$mtime,$mdte,$mhtml);
  15. }
  16.  
  17. createMedOne();
  18.  
  19. function addmed($medid,$mname,$menh,$mtime,$mdte,$mhtml)
  20. {
  21. try
  22. {
  23. $stmt = $this->conn->prepare("INSERT INTO tbl_med(medID,medName,medEnh,medTime,medDate,medHtml)
  24. VALUES(:med_Id, :med_name, :med_enh, :med_time, :med_date, :med_html)");
  25. $stmt->bindparam(":med_Id",$medid); //id of the med
  26. $stmt->bindparam(":med_name",$mname); //name of the med
  27. $stmt->bindparam(":med_enh",$menh); //the amount
  28. $stmt->bindparam(":med_time",$mtime); //When to give med
  29. $stmt->bindparam(":med_date",$mdte); //date
  30. $stmt->bindparam(":med_html",$mhtml); //the html-code to generate content
  31. $stmt->execute();
  32. return $stmt;
  33. }
  34. catch(PDOException $ex)
  35. {
  36. echo $ex->getMessage();
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement