mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-01-29 17:28:27 +00:00
Normalising names of tables
This commit is contained in:
parent
1472692ed5
commit
32e6a356a3
|
@ -97,7 +97,7 @@ class Image {
|
|||
*/
|
||||
function get_image_info($conn, $id) {
|
||||
// Setting SQL query
|
||||
$sql = "SELECT * FROM swag_table WHERE id = ".$id;
|
||||
$sql = "SELECT * FROM images WHERE id = ".$id;
|
||||
// Getting results
|
||||
$query = mysqli_query($conn, $sql);
|
||||
// Fetching associated info
|
||||
|
|
|
@ -27,7 +27,7 @@ if (isset($_POST['submit_delete'])) {
|
|||
// If user owns image or has the ID of 1
|
||||
if ($image_info->image_privilage($image_array['author']) || $_SESSION['id'] == 1) {
|
||||
// Delete from table
|
||||
$sql = "DELETE FROM swag_table WHERE id = ?";
|
||||
$sql = "DELETE FROM images WHERE id = ?";
|
||||
if ($stmt = mysqli_prepare($conn, $sql)) {
|
||||
mysqli_stmt_bind_param($stmt, "i", $param_id);
|
||||
|
||||
|
@ -100,7 +100,7 @@ if (isset($_POST['submit_description'])) {
|
|||
// If user owns image or has the ID of 1
|
||||
if ($image_info->image_privilage($image_array['author']) || $_SESSION['id'] == 1) {
|
||||
// getting ready forSQL asky asky
|
||||
$sql = "UPDATE swag_table SET alt=? WHERE id=?";
|
||||
$sql = "UPDATE images SET alt=? WHERE id=?";
|
||||
|
||||
// Checking if databse is doing ok
|
||||
if ($stmt = mysqli_prepare($conn, $sql)) {
|
||||
|
@ -161,7 +161,7 @@ if (isset($_POST['submit_tags'])) {
|
|||
$tags_string = $make_stuff->tags(trim($_POST['input']));
|
||||
|
||||
// getting ready forSQL asky asky
|
||||
$sql = "UPDATE swag_table SET tags=? WHERE id=?";
|
||||
$sql = "UPDATE images SET tags=? WHERE id=?";
|
||||
|
||||
// Checking if databse is doing ok
|
||||
if ($stmt = mysqli_prepare($conn, $sql)) {
|
||||
|
@ -217,7 +217,7 @@ if (isset($_POST['submit_author'])) {
|
|||
// If user has the ID of 1
|
||||
if ($user_info->is_admin($_SESSION['id'])) {
|
||||
// getting ready forSQL asky asky
|
||||
$sql = "UPDATE swag_table SET author=? WHERE id=?";
|
||||
$sql = "UPDATE images SET author=? WHERE id=?";
|
||||
|
||||
// Checking if databse is doing ok
|
||||
if ($stmt = mysqli_prepare($conn, $sql)) {
|
||||
|
|
|
@ -57,7 +57,7 @@ if (isset($_POST['submit'])) {
|
|||
}
|
||||
|
||||
// Prepare sql for destruction and filtering the sus
|
||||
$sql = "INSERT INTO swag_table (imagename, alt, tags, author) VALUES (?, ?, ?, ?)";
|
||||
$sql = "INSERT INTO images (imagename, alt, tags, author) VALUES (?, ?, ?, ?)";
|
||||
|
||||
if ($stmt = mysqli_prepare($conn, $sql)) {
|
||||
// Bind the smelly smelly
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
<body>
|
||||
<?php
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
require_once __DIR__."/ui/required.php";
|
||||
require_once __DIR__."/ui/nav.php";
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
@ -55,7 +55,7 @@ require_once __DIR__."/ui/nav.php";
|
|||
<div class="gallery-root">
|
||||
<?php
|
||||
// Reading images from table
|
||||
$image_request = mysqli_query($conn, "SELECT * FROM swag_table ORDER BY id DESC");
|
||||
$image_request = mysqli_query($conn, "SELECT * FROM images ORDER BY id DESC");
|
||||
|
||||
while ($image = mysqli_fetch_array($image_request)) {
|
||||
// Getting thumbnail
|
||||
|
|
Loading…
Reference in a new issue