/**
* Programmer : Nitin
* Module : Database Connection
* File Name : DBConnection.php
* Description : Database Connection Class
* Versions : PHP5, Apache 2.0
* Last Modified : 23/08/2006
*/
class DBConnection {
var $connection, $statement, $dbQuery, $dbResult;
// ///////////////////////////////////////////////////// //
// PHP and MySQL Connection and Error Specific methods
// ///////////////////////////////////////////////////// //
function DBConnection()
{
//try {
$dbUsername = MYSQL_DB_USER;
$dbPassword = MYSQL_DB_PWD;
$dbServer = MYSQL_DB_SERVER;
$dbName = MYSQL_DB_NAME;
// Use mysqli_connect instead of deprecated mysql_connect
$connection = mysqli_connect($dbServer, $dbUsername, $dbPassword, $dbName);
if(!$connection) {
$this->saveIntoErrorLog("DBConnection.php", "DBConnection()", "mysqli_connect()", mysqli_connect_error());
return false;
}
// Set charset for the connection
mysqli_set_charset($connection, 'utf8');
$this->connection = $connection;
$this->statement = true; // With mysqli_connect, database is selected automatically
return true;
/*} catch (Exception $e) {
$this->saveIntoErrorLog("DBConnection.php", "DBConnection()", "", $e);
return false;
}*/
}
function CloseConnection()
{
//try {
$close = mysqli_close($this->connection);
if(!$close) {
$this->saveIntoErrorLog("DBConnection.php", "CloseConnection()", "mysqli_close()");
}
return true;
/*} catch (Exception $e) {
$this->saveIntoErrorLog("DBConnection.php", "CloseConnection()", "", $e);
return false;
}*/
}
/**
* Execute query for select
*/
function SelectQuery($fileName="", $methodName="")
{
//try {
if($this->connection && $this->statement)
{
if(empty($this->dbQuery)) { return false; }
$this->dbResult = mysql_query($this->dbQuery, $this->connection);
if(!$this->dbResult) {
$this->saveIntoErrorLog($fileName, $methodName, $this->dbQuery);
return false;
}
$rowCount = 0;
$resultData = array();
while($rowData = mysql_fetch_array($this->dbResult, MYSQL_ASSOC)) {
$resultData[$rowCount] = $rowData;
$rowCount++;
}
mysql_free_result($this->dbResult);
return $resultData;
} else {
return false;
}
/*} catch (Exception $e) {
$this->saveIntoErrorLog($fileName, $methodName, "", $e);
return false;
}*/
}
/**
* Execute query for Insert
*/
function InsertQuery($fileName="", $methodName="")
{
//try {
if($this->connection && $this->statement)
{
if(empty($this->dbQuery)) { return false; }
$this->dbResult = mysql_query($this->dbQuery, $this->connection);
if(!$this->dbResult) {
$this->saveIntoErrorLog($fileName, $methodName, $this->dbQuery);
return false;
}
$id = mysql_insert_id();
mysql_free_result($this->dbResult);
return $id;
} else {
return false;
}
/*} catch (Exception $e) {
$this->saveIntoErrorLog($fileName, $methodName, "", $e);
return false;
}*/
}
/**
* Execute query for Update/Delete
*/
function ExecuteQuery($fileName="", $methodName="")
{
//try {
if($this->connection && $this->statement)
{
if(empty($this->dbQuery)) { return false; }
$this->dbResult = mysqli_query($this->connection, $this->dbQuery);
if(!$this->dbResult) {
$this->saveIntoErrorLog($fileName, $methodName, $this->dbQuery);
return false;
}
$rows = 0;
$rows = mysqli_affected_rows($this->connection);
mysqli_free_result($this->dbResult);
return $rows; } else {
return false;
}
/*} catch (Exception $e) {
$this->saveIntoErrorLog($fileName, $methodName, "", $e);
return false;
}*/
}
/**
* Execute queries for webservice
*/
function SelectQueryResult($fileName="", $methodName="")
{
//try {
if($this->connection && $this->statement)
{
if(empty($this->dbQuery)) { return false; }
$this->dbResult = mysql_query($this->dbQuery, $this->connection);
if(!$this->dbResult) {
$this->saveIntoErrorLog($fileName, $methodName, $this->dbQuery);
return false;
}
$resultData = $this->dbResult;
//mysql_free_result($this->dbResult);
return $resultData;
} else {
return false;
}
/*} catch (Exception $e) {
$this->saveIntoErrorLog($fileName, $methodName, "", $e);
return false;
}*/
}
/**
* Use this method to log the database errors.
*/
function saveIntoErrorLog($fileName="", $methodName="", $sqlQuery="", $exception="")
{
$errorCode = mysql_errno();
$errorText = mysql_error();
$errorMessage = "File: ".$fileName.", Method/Function: ".$methodName.", Query: ".$sqlQuery.", Error: ".$errorCode."-".$errorText;
if($exception != "")
$errorMessage.= " Exception : ".$exception ;
// timestamp for the error entry
$errorMessage = "[".date("j-M-Y H:i:s (T)")."] ".$errorMessage."\r\n";
// save to the error log
error_log($errorMessage, 3, ERROR_LOG."ErrorLog".date("j-M-Y").".log");
}
} //ends the class over here
?>
Connecting to MySQL server: p3plzcpnl506558.prod.phx3.secureserver.net with user: twincitiesfun
SELECT t1.est_id, t1.icon, t1.est_name, t1.est_street, t1.est_city, t1.est_state, t1.est_zip, t1.est_phone, t1.accnt_type, t1.percentoffcard, t2.est_type, t3.ent_type, t5.music_type FROM est_overview AS t1, type_of_est as t2, type_of_entertain as t3, type_of_music as t5 WHERE t1.publish = 'Y' AND t1.est_id = t2.est_id AND t2.est_type = 'Take Out ' AND t1.est_id = t3.est_id AND t3.ent_type = 'Happy Hour' AND t1.est_id = t5.est_id AND t5.music_type = 'Satellite Radio' GROUP BY t1.est_id ORDER BY t1.accnt_type ASC, t1.est_name ASC LIMIT 0, 30Query: SELECT t1.est_id, t1.icon, t1.est_name, t1.est_street, t1.est_city, t1.est_state, t1.est_zip, t1.est_phone, t1.accnt_type, t1.percentoffcard, t2.est_type, t3.ent_type, t5.music_type FROM est_overview AS t1, type_of_est as t2, type_of_entertain as t3, type_of_music as t5 WHERE t1.publish = 'Y' AND t1.est_id = t2.est_id AND t2.est_type = 'Take Out ' AND t1.est_id = t3.est_id AND t3.ent_type = 'Happy Hour' AND t1.est_id = t5.est_id AND t5.music_type = 'Satellite Radio' GROUP BY t1.est_id ORDER BY t1.accnt_type ASC, t1.est_name ASC LIMIT 0, 30
Query: SELECT t1.est_id, t1.icon, t1.est_name, t1.est_street, t1.est_city, t1.est_state, t1.est_zip, t1.est_phone, t1.accnt_type, t1.percentoffcard, t2.est_type, t3.ent_type, t5.music_type FROM est_overview AS t1, type_of_est as t2, type_of_entertain as t3, type_of_music as t5 WHERE t1.publish = 'Y' AND t1.est_id = t2.est_id AND t2.est_type = 'Take Out ' AND t1.est_id = t3.est_id AND t3.ent_type = 'Happy Hour' AND t1.est_id = t5.est_id AND t5.music_type = 'Satellite Radio' GROUP BY t1.est_id ORDER BY t1.accnt_type ASC, t1.est_name ASC
Query: SELECT date_format(date2, '%Y-%c-%e') as ArticleDate FROM featured_events
Query: SELECT eo.est_id, est_name, est_city, icon FROM est_overview as eo, type_of_est as toe WHERE eo.est_id = toe.est_id AND toe.est_type = 'Restaurants' AND eo.accnt_type = 'P' AND publish = 'Y' ORDER BY RAND() LIMIT 3
Query: SELECT eo.est_id, title, `description`, est_name, est_city FROM perks as p, est_overview as eo WHERE eo.est_id = p.est_id AND eo.publish = 'Y' ORDER BY RAND() LIMIT 3
Query: SELECT est_type, count(*) AS Count FROM type_of_est as toe, est_overview as eo WHERE eo.est_id = toe.est_id AND eo.accnt_type = 'P' GROUP BY toe.est_type ORDER BY Count DESC LIMIT 8
Query: SELECT ent_type, count(*) AS Count FROM type_of_entertain as toe, est_overview as eo WHERE eo.est_id = toe.est_id AND eo.accnt_type = 'P' GROUP BY toe.ent_type ORDER BY Count DESC LIMIT 8
Query: SELECT cuisine_type, count(*) AS Count FROM type_of_cuisine as toc, est_overview as eo WHERE eo.est_id = toc.est_id AND eo.accnt_type = 'P' GROUP BY toc.cuisine_type ORDER BY Count DESC LIMIT 8
Query: SELECT music_type, count(*) AS Count FROM type_of_music as tom, est_overview as eo WHERE eo.est_id = tom.est_id AND eo.accnt_type = 'P' GROUP BY tom.music_type ORDER BY Count DESC LIMIT 8
Query: SELECT perks_type, count(*) AS Count FROM type_of_perks as top, est_overview as eo WHERE eo.est_id = top.est_id AND eo.accnt_type = 'P' GROUP BY top.perks_type ORDER BY Count DESC LIMIT 8
Query: SELECT est_city, count(*) AS Count FROM est_overview as eo WHERE eo.accnt_type = 'P' GROUP BY eo.est_city ORDER BY Count DESC LIMIT 8
Query: SELECT event_type, count(*) AS Count FROM daily_events as de, est_overview as eo WHERE eo.est_id = de.est_id GROUP BY de.event_type ORDER BY Count DESC LIMIT 9
Query: SELECT dotw, dotw_num, count(*) AS Count FROM daily_events as de, est_overview as eo WHERE eo.est_id = de.est_id GROUP BY de.dotw, de.dotw_num ORDER BY dotw_num ASC LIMIT 7
1 - 14 of 14 Results |
Query: SELECT t1.est_id, t1.icon, t1.est_name, t1.est_street, t1.est_city, t1.est_state, t1.est_zip, t1.est_phone, t1.accnt_type, t1.percentoffcard, t2.est_type, t3.ent_type, t5.music_type FROM est_overview AS t1, type_of_est as t2, type_of_entertain as t3, type_of_music as t5 WHERE t1.publish = 'Y' AND t1.est_id = t2.est_id AND t2.est_type = 'Take Out ' AND t1.est_id = t3.est_id AND t3.ent_type = 'Happy Hour' AND t1.est_id = t5.est_id AND t5.music_type = 'Satellite Radio' GROUP BY t1.est_id ORDER BY t1.accnt_type ASC, t1.est_name ASC
|
Place to Go: Bars/Nightclubs Catering Outdoor/Patio Receptions/Weddings Reservations Accepted Restaurants Sports Bars Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003689' ORDER BY music_typeMusic: Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003689' ORDER BY ent_typeAmenities Arcade Games Bar Bingo Big Screen TV Brunch Specials Catering Darts Easter & Mothers Day Brunch Family Friendly Happy Hour Karaoke Kids Eat Free Meat Raffle Outdoor/Patio Progressive Bingo Pull tabs Receptions/wedding Restaurant Employee Hospitality Specials Tri-wheel® Wi-Fi
Place to Go: Bars/Nightclubs Billiards/Pool Halls Outdoor/Patio Receptions/Weddings Reservations Accepted Restaurants Sports Bars Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003690' ORDER BY music_typeMusic: Jukebox Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003690' ORDER BY ent_typeAmenities Arcade Games Banquet Big Screen TV Bingo Birthday Parties Brunch Specials Darts Family Friendly Featured Hotspots Happy Hour Indoor Sports Jukebox Karaoke Kids Eat Free Outdoor/Patio Pool Tables Pull tabs Receptions/wedding Restaurant Employee Hospitality Specials Trivia Wi-Fi
Place to Go: Bars/Nightclubs Catering Pizza Reservations Accepted Restaurants Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003671' ORDER BY music_typeMusic: Jukebox Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003671' ORDER BY ent_typeAmenities Arcade Games Bar Bingo Big Screen TV Happy Hour Jukebox Karaoke Progressive Bingo Trivia Wi-Fi
Place to Go: Bars/Nightclubs Reservations Accepted Restaurants Sports Bars Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003709' ORDER BY music_typeMusic: Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003709' ORDER BY ent_typeAmenities Arcade Games Banquet Big Screen TV Birthday Parties Darts Happy Hour Private Party Receptions/wedding Reservations Accepted Wi-Fi
Place to Go: Arcades Bars/Nightclubs Bowling Alleys GLBT Venues Nightclub Outdoor/Patio Pizza Restaurants Sports Bars Take Out
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '002458' ORDER BY music_typeMusic: All Types Jukebox Live Music Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '002458' ORDER BY ent_typeAmenities Arcade Games Banquet Big Screen TV Bingo Birthday Parties Bowling Bowling Leauges Breakfast Darts DTV Family Friendly Happy Hour Jukebox Live Music NFL Sunday Ticket Outdoor/Patio Pull tabs Receptions/wedding Take Out Trivia Wi-Fi
Place to Go: Bars/Nightclubs Breakfest Cafés Catering Coffee/Tea Houses Delivery Ice Cream Parlor Outdoor/Patio Pizza Restaurants Take Out WiFi Hotspots Wine Bar
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003650' ORDER BY music_typeMusic: Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003650' ORDER BY ent_typeAmenities Birthday Parties Breakfast Catering Delivery Family Friendly Happy Hour Outdoor/Patio Wi-Fi
Place to Go: 18+ Clubs Bars/Nightclubs Billiards/Pool Halls Outdoor/Patio Pizza Restaurants Sports Bars Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003670' ORDER BY music_typeMusic: Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003670' ORDER BY ent_typeAmenities Arcade Games Big Screen TV Birthday Parties Happy Hour Indoor Sports Outdoor/Patio Pool Tables Pool Tournaments Take Out Wi-Fi
Place to Go: Bars/Nightclubs Catering Receptions/Weddings Reservations Accepted Restaurants Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003683' ORDER BY music_typeMusic: Country Jukebox Rock Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003683' ORDER BY ent_typeAmenities Banquet Brunch Catering Featured Hotspots Happy Hour Receptions/wedding Wi-Fi
Place to Go: Bars/Nightclubs Catering Outdoor/Patio Receptions/Weddings Reservations Accepted Restaurants Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003685' ORDER BY music_typeMusic: Muzak Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003685' ORDER BY ent_typeAmenities 1/2 Price Bottled Wine Banquet Birthday Parties Catering Family Friendly Happy Hour Live Music Movies Outdoor/Patio Receptions/wedding Wi-Fi Wine Dinner Wine Tasting
Place to Go: Bars/Nightclubs Outdoor/Patio Reservations Accepted Restaurants Sports Bars Take Out Weekend Breakfast/Brunch WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003717' ORDER BY music_typeMusic: Pandora Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003717' ORDER BY ent_typeAmenities Big Screen TV Birthday Parties Brunch Brunch Specials Family Friendly Featured Hotspots Happy Hour Outdoor/Patio Wi-Fi
Place to Go: Arcades Bars/Nightclubs Bowling Alleys Breakfast Fun Music Venue Nightclub Outdoor/Patio Pizza Reservations Accepted Restaurants Sports Bars Take Out Winter Destinations
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '002367' ORDER BY music_typeMusic: All Types Jukebox Live Music Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '002367' ORDER BY ent_typeAmenities Arcade Games Bar Bingo Big Screen TV Bingo Birthday Parties Bowling Bowling Leauges Breakfast Breakfast Weekend Darts Dine in / Take out DTV Family Friendly Happy Hour Indoor Sports Live Music NFL Sunday Ticket Outdoor/Patio Receptions/wedding Reservations Accepted Satellite tv Take Out Trivia Wi-Fi
Place to Go: Bars/Nightclubs Catering Outdoor/Patio Pizza Restaurants Sports Bars Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003678' ORDER BY music_typeMusic: Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003678' ORDER BY ent_typeAmenities Big Screen TV Birthday Parties Catering Family Friendly Happy Hour Outdoor/Patio Wi-Fi
Place to Go: Arcades Bars/Nightclubs Catering Outdoor/Patio Reservations Accepted Restaurants Sports Bars Take Out Weekend Breakfast/Brunch WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '002070' ORDER BY music_typeMusic: Jukebox Satellite Radio
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '002070' ORDER BY ent_typeAmenities Arcade Games Ballon lady (kids) Banquet Bar Bingo Big Screen TV Bingo Birthday Parties Breakfast Breakfast Weekend Brunch Specials Darts DTV Family Friendly Family Fun Gift Cards Happy Hour Jukebox Karaoke Live Music Meeting Room Outdoor/Patio Private Party Pull tabs Reservations Accepted Take Out Trivia Wi-Fi
Place to Go: Bars/Nightclubs Music Venue Nightclub Outdoor/Patio Restaurants Sports Bars Take Out WiFi Hotspots
Query: SELECT tm.music_type FROM type_of_music as tm WHERE tm.est_id = '003651' ORDER BY music_typeMusic: 80's Classic Rock Country Cover Music DJ House Live Music Oldies R&B Rock Satellite Radio Top 40
Query: SELECT te.ent_type FROM type_of_entertain as te WHERE te.est_id = '003651' ORDER BY ent_typeAmenities Arcade Games Bachelor/ette Party Specials Big Screen TV Brunch Brunch Specials Dancing Darts Family Friendly Featured Hotspots Garden Bar Happy Hour Karaoke Ladies Night Live DJ Live Music Progressive Bingo Pull tabs Satellite tv Take Out Texas Hold'em Wi-Fi
1 - 14 of 14 Results |