function getTransaction() { include '../../includes/database.php'; $table = "transactions"; $num = sql_GET_ALL($table, ["ID", "DESC"])[0]["ID"] + 1; $stmt = $db->prepare(sql_PUT($table)); $ex = buildJSONInputWProps($table, ["Amount" => 4.5, "Type" => 1, "ID" => $num]); $stmt->execute($ex); return $num; }
function sql_GET_SORT($req, $bool) { //$bool?"sort by pref":"sort ASC" return $bool ? sql_GET_ALL($req[0], [$req[2], $req[3]]) : sql_GET_ALL($req[0], [$req[2], "ASC"]); }