Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавлена новая функция #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Glorferiel39
Copy link
Contributor

Добавлена новая функция в functions

* @param array $data Ассоциативный массив с данными для шаблона
* @return string Итоговый HTML
*/
function includeTemplate($name, array $data = []) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function includeTemplate(string $name, array $data = []): string
{

*@param string $data
*@return int
*/
function remainingTime(string $date) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавить тип для возвращаемого значения

@@ -29,7 +39,7 @@ function is_date_valid(string $date) : bool {
*
* @return mysqli_stmt Подготовленное выражение
*/
function db_get_prepare_stmt($link, $sql, $data = []) {
function dbGetPrepareStmt($link, $sql, $data = []) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function dbGetPrepareStmt(mysqli $link, string $sql, $data = []): mysqli_stmt
{

created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
email VARCHAR(255) NOT NULL UNIQUE,
name VARCHAR(100) NOT NULL,
passw CHAR(50) NOT NULL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHAR(60)

CREATE TABLE lots (
id INT AUTO_INCREMENT PRIMARY KEY,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
created_title VARCHAR(255) NOT NULL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убрать ненужный префикс created_

end_date DATETIME NOT NULL,
rate_step INT NOT NULL,
author_id INT NOT NULL,
winner_id INT DEFAULT NULL,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

winner_id INT NULL,

FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE
);

CREATE TABLE rate (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants