Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Databases_Assesment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gavin.white
Databases_Assesment
Commits
80423101
Commit
80423101
authored
Jan 19, 2024
by
gavin.white
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
7eea5e2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
Delete.php
Delete.php
+66
-0
No files found.
Delete.php
0 → 100644
View file @
80423101
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Delete Book
</title>
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
integrity=
"sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin=
"anonymous"
>
<style>
body
{
background-color
:
#1d2630
;
color
:
white
;
padding
:
20px
;
}
.container
{
max-width
:
600px
;
margin
:
auto
;
}
.confirmation
{
margin-top
:
20px
;
text-align
:
center
;
}
.back-link
{
display
:
block
;
margin-top
:
20px
;
}
</style>
</head>
<body>
<div
class=
"container"
>
<?php
include
(
"database.php"
);
if
(
isset
(
$_GET
[
"ISBN"
]))
{
$isbn
=
$_GET
[
"ISBN"
];
}
else
{
echo
"<p>ISBN not provided.</p>"
;
exit
;
}
// delete relatd records in BookCopies
$deleteBookCopiesQuery
=
"DELETE FROM BookCopies WHERE book_ISBN =
$isbn
"
;
if
(
mysqli_query
(
$conn
,
$deleteBookCopiesQuery
))
{
$deleteBookQuery
=
"DELETE FROM Book WHERE ISBN =
$isbn
"
;
if
(
mysqli_query
(
$conn
,
$deleteBookQuery
))
{
echo
"<h2 class='text-success'>Book deleted successfully!</h2>"
;
}
else
{
echo
"<p class='text-danger'>Error deleting book: "
.
mysqli_error
(
$conn
)
.
"</p>"
;
}
}
else
{
echo
"<p class='text-danger'>Error deleting book copies: "
.
mysqli_error
(
$conn
)
.
"</p>"
;
}
mysqli_close
(
$conn
);
?>
<div
class=
"confirmation"
>
<a
href=
"BookList.php"
class=
"btn btn-primary"
>
Back to Book List
</a>
</div>
</div>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment