Added a class to retrieve the basic item information data.

This commit is contained in:
2020-04-06 11:51:45 -05:00
parent 353a663501
commit 257d442f40
7 changed files with 79 additions and 23 deletions
+19 -2
View File
@@ -1,8 +1,25 @@
<?php
require "db.php";
function get_category_items($db)
function get_category_items()
{
return mysqli_query($db, "SELECT * FROM `category`");
global $conn;
$items = mysqli_query($conn, "SELECT * FROM `category`");
$conn->close();
return $items;
}
function create_category($name)
{
global $conn;
$statement = $conn->prepare("INSERT INTO `category` (category_name) VALUES (?)");
$statement->bind_param("s", $name);
if($statement->execute() == true){
}
$statement->close();
$conn->close();
}
?>