Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2. $host = 'localhost';
  3. $user = 'id442616_izi';
  4. $db = 'id442616_training';
  5. $pass = '*******';
  6. $con= mysqli_connect($host,$user,$pass,$db);
  7. $N_Cliente = $_POST['Nomb_cliente'];
  8. $N_vende = $_POST['Nomb_vende'];
  9. $total = $_POST['total'];
  10. $sql = "insert into Cabezera (Nomb_cliente,Nomb_vende,total) values ('$N_Cliente','$N_vende','$total')";
  11. if(mysqli_query($con,$sql)){
  12. $last_id = mysqli_insert_id($con);
  13. echo json_encode(array(
  14. "id" => $last_id
  15. )); }else{
  16. echo 'failure';
  17. }
  18. mysqli_close($con);
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement