-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinsert.php
More file actions
executable file
·31 lines (29 loc) · 1.05 KB
/
insert.php
File metadata and controls
executable file
·31 lines (29 loc) · 1.05 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
<?php
require_once './popup/database.php';
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if(!$db_server) due("Error on connection of server: " . mysql_error());
mysql_select_db($db_database) or due("Error occured on Database select: " . mysql_error());
if(isset($_POST['sisi'])){
$fName = $_POST['fName'];
$lName = $_POST['lName'];
$sisi = $_POST['sisi'];
$gender = $_POST['gender'];
$birth = $_POST['birth'];
$programID = $_POST['programID'];
$query = 'PREPARE statement FROM "INSERT INTO student VALUES(?,?,?,?,?,?)"';
mysql_query($query);
$query = "SET @fName = \"$fName\",
@lName = \"$lName\",
@sisi = \"$sisi\",
@gender = \"$gender\",
@programID = \"$programID\",
@birth = \"$birth\" ";
mysql_query($query);
$query = 'EXECUTE statement USING @fName,@lName,@sisi,@gender,@programID,@birth';
mysql_query($query);
$query = 'DEALLOCATE PREPARE statement';
mysql_query($query);
mysql_close($db_server);
header('Location: /listli.php');
}
?>