本文整理匯總了PHP中Database_Connection::databaseConnect方法的典型用法代碼示例。如果您正苦於以下問題:PHP Database_Connection::databaseConnect方法的具體用法?PHP Database_Connection::databaseConnect怎麽用?PHP Database_Connection::databaseConnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Database_Connection
的用法示例。
在下文中一共展示了Database_Connection::databaseConnect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}