/** * 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 ?> 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 = 'Sports Bars' AND t1.est_id = t3.est_id AND t3.ent_type = 'Wi-Fi ' AND t1.est_id = t5.est_id AND t5.music_type = 'All Types' GROUP BY t1.est_id ORDER BY t1.accnt_type ASC, t1.est_name ASC LIMIT 0, 30
Place to Go: Arcades Bars/Nightclubs Bowling Alleys GLBT Venues Nightclub Outdoor/Patio Pizza Restaurants Sports Bars Take Out
Music: All Types Jukebox Live Music Satellite Radio
Amenities 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 Breakfast Catering Receptions/Weddings Reservations Accepted Restaurants Sports Bars Take Out WiFi Hotspots
Music: All Types Jukebox Satellite Radio
Amenities Big Screen TV Birthday Parties Brunch Specials Catering Family Friendly 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
Music: All Types Jukebox Live Music Satellite Radio
Amenities 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: 21+ Clubs Bands Bar Crawl Bars/Nightclubs Bingo service Family Fun Fun Golf Mobile Video Game Entertainment Center Music Venue Nightclub Party Promoter Receptions/Weddings Reservations Accepted Service Social Club Sports Bars WiFi Hotspots Wine Bar
Music: 80's All Types Alternative Big Band/Swing Classic Rock Country Cover Music Custom Blend Hip Hop Jukebox Live Concerts Live Music Mix Oldies Piano Pop R&B Reggae Rock Salsa Varies
Amenities 22 50' Plasma TV's Arcade Games Bachelor/ette Party Specials Bands Bar Bingo Baseball Big Screen TV Bingo Birthday Parties Bowling Cards College Sport Team Specials Dancing Dart Tournaments Featured Hotspots Free Computer access Full-Service Bar Gift Cards GLBT Friendly Happy Hour Indoor Sports Jukebox Karaoke Live Music Meat Raffle Meetings NFL Sunday Ticket Private Party Progressive Bingo Promotional Items Pull tabs Receptions/wedding Reservations Accepted Texas Hold'em TV Wi-Fi
Place to Go: Bars/Nightclubs Nightclub Outdoor/Patio Restaurants Sports Bars Take Out
Music: All Types
Amenities Arcade Games Big Screen TV Brunch Catering College Football Family Friendly Jukebox Ladies Night NFL Sunday Ticket Outdoor/Patio Pool Tables Progressive Bingo Pull tabs Restaurant Employee Night Take Out Wi-Fi
1 - 5 of 5 Results |