-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
customer_update_profile1.php
42 lines (30 loc) · 1.02 KB
/
customer_update_profile1.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
35
36
37
38
39
40
41
42
<?php
session_start();
$mail=$_SESSION['alogin'];
$con=mysqli_connect("localhost","root","","organic_shop_db")or die ("Couldnt connect");
if(isset($_POST["submitd"]))
{
$firstname=$_POST["firstname"];
$lastname=$_POST["lastname"];
$phonem=$_POST["phonem"];
//Fetch existing data
/*$disp="SELECT tbl_login.register_email,tbl_login.password, tbl_registration.user_type_id,tbl_registration.fname,tbl_registration.lname,tbl_registration.mobile_num FROM tbl_login INNER JOIN tbl_registration
ON tbl_login.register_email=tbl_registration.register_email WHERE tbl_login.register_email='$mail'";
*/
//update new data
$q_update="UPDATE tbl_registration SET fname='$firstname',lname='$lastname',phone_no='$phonem' WHERE email='$mail' ";
if(mysqli_query($con,$q_update)==TRUE)
{
echo "<script type='text/javascript'>
alert('Profile updated successfully');
window.location='customer_profile.php';
</script>";
}
else
{
echo "<script type='text/javascript'>
alert('not updated');
</script>";
}
}
?>