-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInsertion1.php
More file actions
48 lines (41 loc) · 1.1 KB
/
Copy pathInsertion1.php
File metadata and controls
48 lines (41 loc) · 1.1 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
<body>
<?php
//open a connection to dbase server
include 'open.php';
// collect the posted value
$item1 = $_POST['item1'];
$item2 = $_POST['item2'];
$item3 = $_POST['item3'];
$item4 = $_POST['item4'];
echo "<h2>Insert into SongReleases Table </h2><br>";
if (!empty($item1) and !empty($item2) and !empty($item3) and !empty($item4)) {
if (!is_numeric($item4)) {
echo "Number of Artists is not a number";
}
else {
$item4_num = (int)$item4;
echo "songID: ";
echo $item1;
echo "\n\n";
echo "artistID: ";
echo $item2;
echo "\n\n";
echo "songType: ";
echo $item3;
echo "\n\n";
echo "Number of Artists: ";
echo $item4;
echo "\n\n";
echo "<br><br>";
if ($result = $conn->query("CALL InsertSongIfIDExists('".$item1."', '".$item2."', '".$item3."', '".$item4_num."');")) {
echo "Call to InsertSongIfIDExists succeeded!<br>";
} else {
echo "The details Fail the Insertion to SongReleases Table<br>";
}
}
} else {
echo "not set";
}
$conn->close();
?>
</body>