implemented article composer functionality + interface, login & signup functionality + interface, auth permission functionality reflected in the nav, and determined a unified accent color accessible in dark and light mode
This commit is contained in:
@@ -20,7 +20,7 @@ if ($_SERVER['HTTP_HOST'] == 'localhost') {
|
||||
/*
|
||||
* Handles any queries that should have only one row results.
|
||||
*/
|
||||
function query_db_one_result($query_stmt)
|
||||
function query_one_result($query_stmt)
|
||||
{
|
||||
$conn = get_connection();
|
||||
$results = mysqli_query($conn, $query_stmt);
|
||||
@@ -32,7 +32,7 @@ function query_db_one_result($query_stmt)
|
||||
return mysqli_fetch_assoc($results);
|
||||
}
|
||||
|
||||
function query_db_one_or_more_results($query_stmt)
|
||||
function query_one_or_more_results($query_stmt)
|
||||
{
|
||||
$conn = get_connection();
|
||||
$results = mysqli_query($conn, $query_stmt);
|
||||
@@ -44,6 +44,23 @@ function query_db_one_or_more_results($query_stmt)
|
||||
return $results;
|
||||
}
|
||||
|
||||
/*
|
||||
* Executes a statement. Type is typically either 0 or 1, where 0 is an INSERT or UPDATE,
|
||||
* and 1 is DELETE. This is to determine whether a boolean value should be returned or
|
||||
* the ID of the row(s).
|
||||
*/
|
||||
function exec_statement($stmt, $type)
|
||||
{
|
||||
$conn = get_connection();
|
||||
$results = mysqli_query($conn, $stmt);
|
||||
|
||||
if ($type == 0)
|
||||
$results = mysqli_insert_id($conn);
|
||||
|
||||
mysqli_close($conn);
|
||||
return $results;
|
||||
}
|
||||
|
||||
function get_connection()
|
||||
{
|
||||
// Connect to the DB
|
||||
|
||||
Reference in New Issue
Block a user