-
Notifications
You must be signed in to change notification settings - Fork 1
/
save.php
33 lines (32 loc) · 1.01 KB
/
save.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
<?php
/**
* Parses and verifies the doc comments for file.
*
* PHP version 5.6
*
* @category PHP
* @package PHPTUT
* @author Teerapuch Kassakul <teerapuch@hotmail.com>
* @copyright 2016 PHPTUT
* @license http://opensource.org/licenses/mit-license.php MIT License
* @link http://teerapuch.com
*/
require 'connect.php';
// Set SQl statment
$sql = 'UPDATE customer_tbl SET
first_name = :first_name,
last_name = :last_name,
email = :email,
country = :country,
ip_address = :ip_address
WHERE id = :id';
$stmt = $db->prepare($sql);
$stmt->bindParam(':first_name', $_POST['firstname'], PDO::PARAM_STR);
$stmt->bindParam(':last_name', $_POST['lastname'], PDO::PARAM_STR);
$stmt->bindParam(':email', $_POST['email'], PDO::PARAM_STR);
$stmt->bindParam(':country', $_POST['country'], PDO::PARAM_STR);
$stmt->bindParam(':ip_address', $_POST['ip'], PDO::PARAM_STR);
$stmt->bindParam(':id', $_POST['id'], PDO::PARAM_INT);
$stmt->execute();
header('Location: index.php');
exit;