-
Notifications
You must be signed in to change notification settings - Fork 0
/
insert_person_db.php
34 lines (34 loc) · 1.03 KB
/
insert_person_db.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
session_start();
?>
<html>
<body>
<?php
require("connection.php");
$VAT_person = $_SESSION["VAT_client"];
$pname = $_REQUEST['pname'];
$pstreet = $_REQUEST['pstreet'];
$pcity = $_REQUEST['pcity'];
$pzip = $_REQUEST['pzip'];
$pphone = $_REQUEST['pphone'];
$stmt= $connection->prepare("INSERT INTO person VALUES (:VAT_person,:pname,:pstreet,:pcity,:pzip);
INSERT INTO phone_number VALUES(:VAT_person,:pphone);
INSERT INTO client VALUES(:VAT_person);");
if ($stmt == FALSE)
{
$info = $connection->errorInfo();
echo("<p>Error: {$info[2]}</p>");
exit();
}
$stmt->bindParam(':VAT_person', $VAT_person);
$stmt->bindParam(':pname', $pname);
$stmt->bindParam(':pstreet', $pstreet);
$stmt->bindParam(':pcity', $pcity);
$stmt->bindParam(':pzip', $pzip);
$stmt->bindParam(':pphone', $pphone);
$stmt->execute();
$connection = null;
header("Location: check_animal.php");
?>
</body>
</html>