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


PHP closeDB函数代码示例

本文整理汇总了PHP中closeDB函数的典型用法代码示例。如果您正苦于以下问题:PHP closeDB函数的具体用法?PHP closeDB怎么用?PHP closeDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: PHPTutorials

function PHPTutorials()
{
    //echo$ip=getIp();
    echo "\n<div class='container_fluid'>\n<center><table width='800'>\n    <tr>";
    openDB();
    $getPro_id = mysql_query("select * from products where product_link='php.php'");
    $split = 0;
    while ($row_pro = mysql_fetch_array($getPro_id)) {
        $prod_id = $row_pro['product_id'];
        $prod_title = $row_pro['product_title'];
        $prod_price = $row_pro['product_price'];
        $prod_image = $row_pro['product_image'];
        $pro_desc = $row_pro['product_desc'];
        $split++;
        echo "\n\t\t\t\t\t\t<td width='400' style='padding:5px;'><h3>{$prod_title}</h3>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<a href='../pages/details2.php?pro_id={$prod_id}'>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<image src='../Images/{$prod_image}' width='200' height='100'></image></a>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<h4><strong>Price: \$ {$prod_price}</strong></h4>\n\t\t\t\t\t\t<br><br><h4>Description:</h4><br>{$pro_desc}<br><br>\n\t\t\t\t\t\t<a href='../pages/details2.php?pro_id={$prod_id}'>Details</a>\n\t\t\t\t\t\t<a href='http://www.smcleodtech.com.au/index.php?add_cart={$prod_id}'>\n\t\t\t\t\t\t<button>Add to Cart</button></a></td>";
        if ($split % 3 == 0) {
            echo "\n\t\t\t\t\t\t</tr><tr>";
        }
    }
    cart();
    closeDB();
    echo "</tr><br>\n    </table></center>\n    </div>";
}
开发者ID:ScottRMcleod,项目名称:PHP,代码行数:23,代码来源:functions2.php

示例2: save

 public function save()
 {
     $connection = connectDB();
     $query = "UPDATE Transactions\n\t\t\t\tSET FirstName = '{$this->fname}',\n\t\t\t\tLastName = '{$this->lname}',\n\t\t\t\tEmail = '{$this->email}',\n\t\t\t\tPayment = '{$this->payment}',\n\t\t\t\tFinalToPay = '{$this->finalToPay}',\n\t\t\t\tPaypalMail = '{$this->PaypalMail}',\n\t\t\t\tBankNr = '{$this->BankNr}',\n\t\t\t\tAccountNr = '{$this->AccountNr}',\n\t\t\t\tStatusDate = '{$this->StatusDate}',\n\t\t\t\tRejectOption = '{$this->RejectOption}',\n\t\t\t\tOrderDate = '{$this->OrderDate}',\n\t\t\t\tReceptionDate = '{$this->ReceptionDate}',\n\t\t\t\tProcessedDate = '{$this->ProcessedDate}',\n\t\t\t\tPaymentDate = '{$this->PaymentDate}',\n\t\t\t\tFinishedDate = '{$this->FinishedDate}'\n\t\t\t\tWHERE id={$this->id}";
     echo $query;
     mysql_query($query);
     closeDB($connection);
 }
开发者ID:JiaoMing,项目名称:Kleiderkuh,代码行数:8,代码来源:TransactionClothes.php

示例3: getCountiesMap

function getCountiesMap()
{
    global $mysqli;
    connectDB();
    $result_set = $mysqli->query("\n        SELECT * FROM `counties`\n        WHERE NOT(`map` = ' ')\n    ");
    closeDB();
    return resultSetToArray($result_set);
}
开发者ID:vitkarpov,项目名称:sitterbook,代码行数:8,代码来源:function.php

示例4: getFile

function getFile($limit)
{
    global $mysqli;
    connectDB();
    $result = $mysqli->query("SELECT * FROM `office`.`tbl_uploads` ORDER BY `ID` DESC LIMIT {$limit}");
    closeDB();
    return resultToArray($result);
}
开发者ID:prisacariion,项目名称:midps,代码行数:8,代码来源:functions.php

示例5: getList

function getList($table, $page, $pageSize)
{
    global $mysqli;
    connectDB();
    $first = ($page - 1) * $pageSize;
    $result = $mysqli->query("SELECT * FROM {$table} ORDER BY id DESC LIMIT {$first}, {$pageSize}");
    closeDB();
    return resultToArray($result);
}
开发者ID:AlexKolokolov,项目名称:coderlibrary-php,代码行数:9,代码来源:functions2.php

示例6: getFooter

function getFooter()
{
    ?>

</body>
</html>

<?php 
    closeDB();
}
开发者ID:scoil44,项目名称:LagerPi,代码行数:10,代码来源:footer.php

示例7: main

function main()
{
    global $wonitorDb;
    $db = openDB($wonitorDb);
    try {
        queryDB($db);
    } catch (PDOException $e) {
        echo $e->getMessage();
    }
    closeDB($db);
}
开发者ID:eBrute,项目名称:wonitor,代码行数:11,代码来源:getInfo.php

示例8: checkUser

function checkUser($login, $password)
{
    if ($login == "" || $password == "") {
        require_false;
    }
    $mysqli = connectDB();
    $result_set = $mysqli->query("SELECT password, activation FROM users WHERE login = '{$login}'");
    $user = $result_set->fetch_assoc();
    $real_password = $user["password"];
    $act = $user['activation'];
    if ($act != "") {
        return false;
    }
    closeDB($mysqli);
    return $real_password == $password;
}
开发者ID:romjkeeee,项目名称:3,代码行数:16,代码来源:functions.php

示例9: connectDB

<div class="headline"><?php 
echo $buy_headline1;
?>
</div>
<div>
<?php 
include 'db.php';
include 'language.php';
$email = $_POST['buy_email'];
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    $verbindung = connectDB();
    $abfrage = "SELECT Email\n\t\t\t\tFROM Feedback\n\t\t\t\tWHERE Email LIKE '{$email}'\n\t\t\t\tAND Reason LIKE 'Buy'\n\t\t\t\t";
    $ergebnis = mysql_query($abfrage);
    if (mysql_num_rows($ergebnis) > 0) {
        // The Email is allready in the Buy feedback
        echo $buy_text2;
    } else {
        // store the mail adress
        $insert = "INSERT INTO Feedback (Email, Reason)\n\t\t\t\t\tVALUES ('{$email}', 'Buy')";
        mysql_query($insert);
        echo $buy_text3;
        echo "<br />Email: {$email}";
    }
    closeDB($verbindung);
} else {
    include 'buy.php';
    echo "<br /><br /><br /><div class='orange'>{$buy_error1} {$email}</div>";
}
?>
</div>
开发者ID:JiaoMing,项目名称:Kleiderkuh,代码行数:30,代码来源:buy_storeEmail.php

示例10: getItinerary

function getItinerary($IID)
{
    $connection = initDB();
    $query;
    if ($IID == 0) {
        $query = "SELECT * FROM Itinerary";
    } else {
        $query = "SELECT * FROM Itinerary WHERE IID='" . $IID . "'";
    }
    $result = mysql_query($query);
    //or die ("Query Failed ".mysql_error());
    $itineraryID = 0;
    $itineraryData;
    while ($row = mysql_fetch_array($result)) {
        $GID = $row['GID'];
        $FID = $row['FID'];
        $SID = $row['SID'];
        //Retrieve Guest Information
        $query2 = "SELECT * FROM Guest WHERE GID='" . $GID . "'";
        $result2 = mysql_query($query2);
        $row2 = mysql_fetch_array($result2);
        $firstName = $row2['FirstName'];
        $lastName = $row2['LastName'];
        //Retrieve Travel Schedule Information
        $query3 = "SELECT * FROM Schedule WHERE SID='" . $SID . "'";
        $result3 = mysql_query($query3);
        $row3 = mysql_fetch_array($result3);
        $travelDate = $row3['Date'];
        //Retrieve Sector Information
        $query3 = "SELECT * FROM Flights WHERE FID='" . $FID . "'";
        $result3 = mysql_query($query3);
        $row3 = mysql_fetch_array($result3);
        $sourceSID = $row3['SourceSID'];
        $destSID = $row3['DestSID'];
        $fName = $row3['FName'];
        $query4 = "SELECT Sector FROM Sectors WHERE SID='" . $sourceSID . "'";
        $result4 = mysql_query($query4);
        $row4 = mysql_fetch_array($result4);
        $source = $row4['Sector'];
        $query4 = "SELECT Sector FROM Sectors WHERE SID='" . $destSID . "'";
        $result4 = mysql_query($query4);
        $row4 = mysql_fetch_array($result4);
        $dest = $row4['Sector'];
        //Build GuestItinerary object
        $guestItinerary = new GuestItinerary();
        $guestItinerary->set_FID($FID);
        $guestItinerary->set_FName($fName);
        $guestItinerary->set_SID($SID);
        $guestItinerary->set_source($source);
        $guestItinerary->set_dest($dest);
        $guestItinerary->set_travelDate($travelDate);
        $guestItinerary->set_GID($GID);
        $guestItinerary->set_firstName($firstName);
        $guestItinerary->set_lastName($lastName);
        $itineraryData[$itineraryID] = $guestItinerary;
        $itineraryID = $itineraryID + 1;
    }
    closeDB($connection);
    return $itineraryData;
}
开发者ID:flyeven,项目名称:Meet-Univ,代码行数:60,代码来源:itinerarymanager.php

示例11: connectToDB

require_once 'global.php';
require 'db_query.php';
$cookie_name = "user_id";
$uid_isset = false;
$uid_isvalid = false;
if (!isset($_COOKIE[$cookie_name])) {
    $uid_isset = false;
} else {
    $uid_isset = true;
    connectToDB();
    $table_name = 'users';
    $user_id = $_COOKIE[$cookie_name];
    $user_name = $_COOKIE["user_name"];
    $uid_isvalid = checkUsersWithID($user_id);
    closeDB();
}
?>
<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="utf-8">
        <title>Create life like you create your innovative drinks!</title>
        <link rel="stylesheet" href="/create_your_own_drink/CSS/main.css">
        <link href='http://fonts.googleapis.com/css?family=Sigmar+One|Monoton|Pinyon+Script|Rock+Salt|Kaushan+Script|Julius+Sans+One|Kranky|Coming+Soon' rel='stylesheet' type='text/css'>
    </head>

    <body>
        <header id="index-header">
            <?php 
开发者ID:agnesQ,项目名称:Create-Your-Own-Drink,代码行数:30,代码来源:header.php

示例12: addUserToDB

function addUserToDB($firstName, $lastName, $username, $password, $usertype)
{
    $con = connectToDB();
    $uniqueID = uniqid();
    //echo $uniqueID;
    $sql = "INSERT INTO User VALUES('{$uniqueID}', '{$firstName}', '{$lastName}','{$usertype}');";
    if (!mysqli_query($con, $sql)) {
        echo "Errormessage: ", mysqli_error($con);
    } else {
        echo "Successfull insert.\n";
    }
    //insert into credentials
    $sql = "INSERT INTO Credentials(uniqueID, username, password) VALUES('{$uniqueID}', '{$username}', '{$password}');";
    if (!mysqli_query($con, $sql)) {
        echo "Errormessage: ", mysqli_error($con);
    } else {
        echo "Successfull insert.\n";
    }
    closeDB($con);
}
开发者ID:gavmac11,项目名称:Practice-PHP-and-mySQL,代码行数:20,代码来源:functions.php

示例13: performQuery

function performQuery($query)
{
    // Open the database.
    $db = openDB();
    // Query the database.
    $queryResult = mysql_query($query, $db);
    // If there is an error, return the error.
    if (!$queryResult) {
        $result = array("status" => 0, "error" => array("6", "Database query error: " . mysql_error()));
        packageResponse($result);
        exit;
    }
    // Close the database and return the result.
    closeDB($db);
    return $queryResult;
}
开发者ID:pbergstr,项目名称:PaperCube,代码行数:16,代码来源:request.php

示例14: endPage

/** -----------------------------
 * add page ending tags
 ----------------------------*/
function endPage()
{
    print '</body></html>';
    try {
        closeDB();
        //not care about the exception
    } catch (Exception $e) {
    }
}
开发者ID:warunap,项目名称:haaprojects,代码行数:12,代码来源:_html_content_lib.php

示例15: getRawGMList

function getRawGMList($leagueID)
{
    $season = getSeason();
    $sql = "select teamDisplayName from fch_league_membership where leagueID = {$leagueID} and status = \"active\" and season = \"{$season}\" ORDER BY teamDisplayName ASC";
    $con = initializeDB();
    $result = $con->query($sql);
    if ($result->num_rows > 0) {
        // output data of each row
        while ($row = $result->fetch_assoc()) {
            $out .= $row["teamDisplayName"] . "<br/>";
        }
    }
    closeDB($con);
    return $out;
}
开发者ID:BobHatcher,项目名称:FantasyCollegeHockey,代码行数:15,代码来源:fch-lib.php


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