當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Database_Connection::createDatabase方法代碼示例

本文整理匯總了PHP中Database_Connection::createDatabase方法的典型用法代碼示例。如果您正苦於以下問題:PHP Database_Connection::createDatabase方法的具體用法?PHP Database_Connection::createDatabase怎麽用?PHP Database_Connection::createDatabase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Database_Connection的用法示例。


在下文中一共展示了Database_Connection::createDatabase方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: queryAllStoreInfo

 public function queryAllStoreInfo()
 {
     include_once '../Database/Database_Connection.php';
     $databaseConnection = new Database_Connection();
     $databaseConnection->createDatabase();
     $databaseConnection->databaseConnect();
     $sql = "select * from scudsbook_store_info";
     $result = mysqli_query($databaseConnection->conn, $sql);
     $i = 1;
     if ($result->num_rows > 0) {
         // output data of each row
         while ($row = $result->fetch_assoc()) {
             $this->_store_name[$i] = $row['store_name'];
             $this->_store_rating[$i] = $row['store_rating'];
             $this->_store_category[$i] = $row['store_category'];
             $this->_store_location_lat[$i] = $row['store_location_lat'];
             $this->_store_location_lan[$i] = $row['store_location_lan'];
             $this->_default_address_street[$i] = $row['address_street'];
             $this->_default_address_street_ref[$i] = $row['address_ref'];
             $this->_default_address_city[$i] = $row['address_city'];
             $this->_default_address_state[$i] = $row['address_state'];
             $this->_default_address_zip[$i] = $row['address_zip'];
             $this->_default_address_country[$i] = $row['address_country'];
             $i++;
         }
     } else {
         echo "0 results";
     }
     mysqli_close($databaseConnection->conn);
     $databaseConnection->conn_state = false;
 }
開發者ID:scudsbook,項目名稱:project_scudsbook,代碼行數:31,代碼來源:Store_Information.php

示例2: geocode

showStoreInfo();
?>

        <br><br>
        <div id="delete_store" align="center">
            <input type=text name=_delete_store id=_delete_store>
            <input type=submit name=delete id="delete_address" value=delete>
        </div>
    </form>
</div>

<?php 
if ($_POST) {
    include_once '../Database/Database_Connection.php';
    $databaseConnection = new Database_Connection();
    $databaseConnection->createDatabase();
    $_store_name = $_POST['_store_name'];
    if (!empty($_store_name)) {
        $_store_rating = $_POST['_store_rating'];
        $_store_category = $_POST['_store_category'];
        $_default_address_street = $_POST['_default_address_street'];
        $_default_address_city = $_POST['_default_address_city'];
        $_default_address_state = $_POST['_default_address_state'];
        $_default_address_zip = $_POST['_default_address_zip'];
        $_default_address_country = $_POST['_default_address_country'];
        // get latitude, longitude and formatted address
        $data_arr = geocode($_default_address_street . ',' . $_default_address_city . ',' . $_default_address_state . ',' . $_default_address_zip . ',' . $_default_address_country);
        // if able to geocode the address
        if ($data_arr) {
            $latitude = $data_arr[0];
            $longitude = $data_arr[1];
開發者ID:scudsbook,項目名稱:project_scudsbook,代碼行數:31,代碼來源:Database_Store_Manager.php


注:本文中的Database_Connection::createDatabase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。