<?php
$dataQuery = "
  SELECT
    B.beitrag AS comment,
    DATE_FORMAT(B.zeitstempel, '%d.%m.%y %H:%i') AS time,
    U.benutzer AS name
  FROM
    egb_gaestebuch AS B,
    egb_benutzer AS U
  WHERE
    B.benutzer_id = U.id
  ORDER BY
    B.zeitstempel DESC
  LIMIT 9
  OFFSET ";

$countQuery = "
  SELECT
    COUNT(*)
  FROM
    egb_gaestebuch";

$loginQuery = "
  SELECT
    *
  FROM
    egb_benutzer
  WHERE
    benutzer LIKE :USR AND
    status = 1";

$updatePasswordQuery = "
  UPDATE
    egb_benutzer
  SET
    passwort = :PAS
  WHERE
    id = :UID";

$insertCommentQuery = "
  INSERT INTO
    egb_gaestebuch(benutzer_id, beitrag)
  VALUES
    (:UID, :COM)";

$insertUserQuery = "
  INSERT INTO
    egb_benutzer(benutzer, passwort, email, confirmationcode)
  VALUES(:USR, :PAS, :EMA, :COD)";

$confirmFetchUserQuery = "
  SELECT
    ID
  FROM
    egb_benutzer
  WHERE
    confirmationcode LIKE :COD";

$confirmUserQuery = "
  UPDATE
    egb_benutzer
  SET
    status = 1
  WHERE id = :UID";
