Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. //clase precios
  5.  
  6. class price{
  7.  
  8. $dbhost = "localhost";
  9. $dbuser = "siften_data";
  10. $dbpass = "data1234";
  11.  
  12. Var $error;
  13. //login base de datos
  14. $mysqli = new mysqli($dbhost, $dbuser, $dbpass, "siften_database.db");
  15.  
  16.  
  17. Function Insert($ins){
  18.  
  19. if (!empty($ins)){
  20.  
  21. $mysqli-> query("INSERT INTO prices (name, price_unit, price_discount, amount_discount) VALUES ($name,$price, $discount, $amount)");
  22. }
  23.  
  24. }
  25.  
  26. Function edit($edi){
  27.  
  28. if (!empty($edi)){
  29.  
  30. $mysqli-> query("UPDATE user SET price_unit=$price, name=$name, price_discount=$discount, amount_discount=$amount WHERE id_price=$id");
  31. }
  32.  
  33. }
  34.  
  35. Function delete($del){
  36.  
  37. if (!empty($ins)){
  38.  
  39. $mysqli-> query("Delete from prices where id_price=$id");
  40. }
  41.  
  42. }
  43.  
  44.  
  45. //fin clase
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement