-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrateTitle.php
44 lines (35 loc) · 1.26 KB
/
rateTitle.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
43
44
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
if(!isset($_GET['pnumber'])) {
echo "No patron information was sent - title can't be rated!";
} else {
$pnumber = $_GET['pnumber'];
}
if(!isset($_GET['bib_record_metadata_id'])) {
echo "No title information was sent - title can't be rated!";
} else {
$bib_record_metadata_id = $_GET['bib_record_metadata_id'];
}
if(!isset($_GET['rating'])) {
echo "No rating information was sent - title can't be rated!";
} else {
$rating = $_GET['rating'];
}
//Database connections
include_once ("./includes/db_connect.inc");
//Connect to the overlooked_gems database
$overlookedGemsLink = db_overlooked_gems() or die ("Cannot connect to server");
$rateQuery = " UPDATE `2018_reading_history`
SET rating = '{$rating}'
WHERE pnumber = {$pnumber}
AND bib_record_metadata_id = {$bib_record_metadata_id};";
$rateResult = mysqli_query($overlookedGemsLink, $rateQuery) or die(mysqli_error($overlookedGemsLink));
if($rateResult === TRUE) {
echo $rating;
} else {
echo "RATING UNSUCESSFUL";
}
mysqli_close($overlookedGemsLink);
unset($overlookedGemsLink);
?>