-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathedit.php
More file actions
35 lines (30 loc) · 1.38 KB
/
edit.php
File metadata and controls
35 lines (30 loc) · 1.38 KB
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
<?php
// configuration
//include('connect.php');
$db = new PDO('mysql:host=localhost;dbname=ndere_boys','root','');
//$conn = mysqli_connect("localhost", "root", "", "kephis" ) or die(mysqli_error());
// new data
//$name = $_POST['Name'];
$id=isset($_POST['enr_id']);
$studentFName = isset($_POST['studentFName']);
$studentMName = isset($_POST['studentMName']);
$studentLName = isset($_POST['studentLName']);
$studentDOB= isset($_POST['studentDOB']);
$gender = isset($_POST['gender']);
$studentCounty = isset($_POST['studentCounty']);
$formerInstitution = isset($_POST['formerInstitution']);
$classtoJoin = isset($_POST['classJoin']);
$parentName = isset($_POST['parentName']);
$mobileNumber = isset($_POST['mobileNumber']);
$email = isset($_POST['email']);
$County = isset($_POST['County']);
$id = isset($POST[':userid']);
//query
$sql = "UPDATE enrolment
SET studentFName=?, studentMName=?, studentLName=?, studentDOB=?, gender=?, studentCounty=?, formerInstitution=?, classJoin=?, parentName=?, mobileNumber=?, email=?, County=?
WHERE id=?";
$q = $db->prepare($sql);
$q->execute(array($id,$studentFName,$studentMName, $studentLName, $studentDOB,$gender,$studentCounty,$formerInstitution,$classtoJoin,$parentName,$mobileNumber,$email,$County));
//header("location: index.php");
echo "Update complete <a href='index.html'>Click here to Exit</a>";
?>