Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost';
- $user = 'id442616_izi';
- $db = 'id442616_training';
- $pass = '*******';
- $con= mysqli_connect($host,$user,$pass,$db);
- $N_Cliente = $_POST['Nomb_cliente'];
- $N_vende = $_POST['Nomb_vende'];
- $total = $_POST['total'];
- $sql = "insert into Cabezera (Nomb_cliente,Nomb_vende,total) values ('$N_Cliente','$N_vende','$total')";
- if(mysqli_query($con,$sql)){
- $last_id = mysqli_insert_id($con);
- echo json_encode(array(
- "id" => $last_id
- )); }else{
- echo 'failure';
- }
- mysqli_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement