本文整理汇总了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;
}
示例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];