-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatainsertion.php
More file actions
161 lines (63 loc) · 1.81 KB
/
datainsertion.php
File metadata and controls
161 lines (63 loc) · 1.81 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
$servername = "sql209.epizy.com";
$username = "epiz_26484414";
$password = "v7LaC4oyfg";
$dbname = "epiz_26484414_quiz";
$conn = new mysqli($servername, $username, $password, $dbname);
function python($name, $no)
{
$quizname = 'Python';
$totalmarks = 25;
global $conn;
$sql = "INSERT INTO userprofile (username, subjects, totalmarks, score)
VALUES ('$name', '$quizname', '$totalmarks', '$no')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
function php($name, $no)
{
global $conn;
$quizname = 'PHP';
$totalmarks = 25;
$sql = "INSERT INTO userprofile (username, subjects, totalmarks, score)
VALUES ('$name', '$quizname', '$totalmarks', '$no')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
function html($name, $no)
{
global $conn;
$quizname = 'HTML';
$totalmarks = 25;
$sql = "INSERT INTO userprofile (username, subjects, totalmarks, score)
VALUES ('$name', '$quizname', '$totalmarks', '$no')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
function css($name, $no)
{
global $conn;
$quizname = 'CSS';
$totalmarks = 25;
$sql = "INSERT INTO userprofile (username, subjects, totalmarks, score)
VALUES ('$name', '$quizname', '$totalmarks', '$no')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
?>