当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseConnection::get_db_link方法代码示例

本文整理汇总了PHP中DatabaseConnection::get_db_link方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseConnection::get_db_link方法的具体用法?PHP DatabaseConnection::get_db_link怎么用?PHP DatabaseConnection::get_db_link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseConnection的用法示例。


在下文中一共展示了DatabaseConnection::get_db_link方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DatabaseConnection

            </div>';
$isLogged = false;
if (isset($_POST["username"])) {
    $usr = $_POST['username'];
    $pwd = $_POST['password'];
    $isLogged = true;
}
if (isset($_SESSION["username"])) {
    $usr = $_SESSION['username'];
    $pwd = $_SESSION['password'];
    $isLogged = true;
}
if ($isLogged) {
    $conn = new DatabaseConnection();
    $query = "SELECT * FROM Admin WHERE Username = " . $usr . " AND Password=" . $pwd;
    if (!mysqli_query($conn->get_db_link(), $query)) {
        $loginMessage = " - Dati incorretti!";
        echo $loginFormWitError;
    } else {
        $_SESSION["username"] = $usr;
        $_SESSION["password"] = $pwd;
        echo $addProductHTML;
    }
} else {
    echo $loginForm;
}
?>

<?php 
require "footer.php";
?>
开发者ID:albertogiunta,项目名称:Amigurumi_eCommerce,代码行数:31,代码来源:login.php

示例2: setcookie

}
if (!isset($_COOKIE['orderCriteria'])) {
    setcookie('orderCriteria', 'ASC');
    $_COOKIE['orderCriteria'] = 'ASC';
}
//Se ho premuto "aggiungi al carrello", ho passato alla pagina un id
require "header.php";
require "../Controller/TileController.php";
require "../Controller/DatabaseConnection.php";
require "../Controller/CatalogRequestsController.php";
?>


<?php 
$conn = new DatabaseConnection();
$req = new CatalogRequestsController($conn->get_db_link());
$tileC = new TileController();
$catalogItems = '';
$elemInPage = 12;
// change number also in pagination.js
$visibility = '';
$products = $req->getCatalogArray();
for ($i = 0; $i < sizeof($products); $i++) {
    if ($i >= $elemInPage) {
        $visibility = 'hidden';
    }
    $catalogItems = $catalogItems . $tileC->getSmallSquare($visibility, $products[$i]->getId(), $products[$i]->getName(), $products[$i]->getPrice(), $products[$i]->getImage());
}
$turkey = '<div class="catalog-cont">';
$stuffing = $req->getTitleAndPaging(true) . $catalogItems . $req->getTitleAndPaging(false);
echo $tileC->getSearchSection() . $tileC->getDetailedProduct() . $tileC->insertIntoDiv($turkey, $stuffing);
开发者ID:albertogiunta,项目名称:Amigurumi_eCommerce,代码行数:31,代码来源:catalogo.php

示例3: DatabaseConnection

<?php

require "Controller/DatabaseConnection.php";
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test</title>
</head>
<body>
    <?php 
error_reporting(E_ALL);
ini_set('display_errors', 1);
$conn = new DatabaseConnection();
$query = "SELECT * FROM Product";
$prod = mysqli_query($conn->get_db_link(), $query);
while ($row = mysqli_fetch_assoc($prod)) {
    echo $row['ID_Prod'] . "  " . $row['Name'];
}
mysqli_close($conn->get_db_link());
?>
</body>
</html>
开发者ID:albertogiunta,项目名称:Amigurumi_eCommerce,代码行数:25,代码来源:index.php

示例4: DatabaseConnection

<?php

/**
 * Created by PhpStorm.
 * User: albertogiunta
 * Date: 25/01/16
 * Time: 10:47
 */
session_start();
require "../Controller/DatabaseConnection.php";
require "../Controller/CatalogRequestsController.php";
$conn = new DatabaseConnection();
$req = new CatalogRequestsController($conn->get_db_link());
if (isset($_GET["logout"])) {
    if ($_GET["logout"] == "ok") {
        $_SESSION["username"] = null;
        $_SESSION["password"] = null;
        session_destroy();
        header("Location: ../View/home.php");
    }
}
if (isset($_GET["detailsId"])) {
    $details = $req->getDetailedInformation($_GET["detailsId"]);
    echo json_encode($req->parseArray($details)[0]);
}
if (isset($_GET["prodName"])) {
    $searchResults = $req->getSearchResults($_GET["prodName"]);
    $parsedArray = $req->parseArray($searchResults);
    $encoded = json_encode($parsedArray);
    echo $encoded;
}
开发者ID:albertogiunta,项目名称:Amigurumi_eCommerce,代码行数:31,代码来源:ajaxController.php

示例5: DatabaseConnection

 */
$title = "HOME";
require "header.php";
require "../Controller/TileController.php";
require "../Controller/DatabaseConnection.php";
require "../Controller/HomepageRequestsController.php";
?>

<div class="presentation">
    <p>Amigurumi Life è un progetto fondato nel 2012, con base a Padova.</p>
    <p>Produciamo piccole perle arricchite di preziosi dettagli, per persone che non si accontentano e che amano trovare la bellezza anche nelle più piccole cose.</p>
</div>

<?php 
$conn = new DatabaseConnection();
$req = new HomepageRequestsController($conn->get_db_link());
$tileC = new TileController();
/*
 * RECENT PRODUCTS
 * */
$recentProducts = $req->getMostRecent();
$turkey = '<div class="recently-added-cont">';
$stuffing = $tileC->getTitle('Aggiunti di recente');
$mostRecent = "";
$lessRecent = "";
for ($i = 0; $i < 3; $i++) {
    if (isset($recentProducts[$i])) {
        if ($i < 1) {
            $mostRecent = $tileC->getLongTileItem('most-recent ', $recentProducts[$i]->getId(), $recentProducts[$i]->getName(), $recentProducts[$i]->getPrice(), $recentProducts[$i]->getDescription(), $recentProducts[$i]->getImage());
        } else {
            $lessRecent = $lessRecent . $tileC->getShortTileItem($recentProducts[$i]->getId(), $recentProducts[$i]->getName(), $recentProducts[$i]->getPrice(), $recentProducts[$i]->getImage());
开发者ID:albertogiunta,项目名称:Amigurumi_eCommerce,代码行数:31,代码来源:home.php

示例6: DatabaseConnection

<?php

/**
 * Created by PhpStorm.
 * User: albertogiunta
 * Date: 28/01/16
 * Time: 10:40
 */
require "DatabaseConnection.php";
$conn = new DatabaseConnection();
$link = $conn->get_db_link();
$name = mysqli_real_escape_string($link, $_POST["name"]);
$email = mysqli_real_escape_string($link, $_POST["email"]);
$message = mysqli_real_escape_string($link, $_POST["message"]);
date_default_timezone_set('Europe/Rome');
$datetime = date("Y-m-d H:i:s");
$query = "INSERT INTO Contacts (Name, Email, Message, Date) VALUES ('{$name}', '{$email}', '{$message}', '{$datetime}')";
if (!mysqli_query($link, $query)) {
    $get = 'failed';
} else {
    $get = 'ok';
}
header("Location: ../View/contattaci.php?response=" . $get);
开发者ID:albertogiunta,项目名称:Amigurumi_eCommerce,代码行数:23,代码来源:InsertContactInformation.php


注:本文中的DatabaseConnection::get_db_link方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。