/** * 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, t3.ent_type, t4.cuisine_type, t5.music_type FROM est_overview AS t1, type_of_entertain as t3, type_of_cuisine as t4, type_of_music as t5 WHERE t1.publish = 'Y' AND t1.est_id = t3.est_id AND t3.ent_type = 'Wi-Fi ' AND t1.est_id = t4.est_id AND t4.cuisine_type = 'Pizza' AND t1.est_id = t5.est_id AND t5.music_type = 'Blues ' GROUP BY t1.est_id ORDER BY t1.accnt_type ASC, t1.est_name ASC LIMIT 0, 30
Music: Acoustic Alternative Blues Country DJ Eclectic Folk Hip Hop House Irish Jazz Latin Live Concerts Live Music Other R&B Reggae Rock World
Cuisine: American Fish French Greek Mexican Muffins Organic Pizza Salad Soup Thai Vegan Vegetarian
Amenities Birthday Parties Brunch Catering Family Friendly Happy Hour Live Music Open Mic/Amateur Night Outdoor/Patio Receptions/wedding Wi-Fi
Music: 80's All Types Bar Top 40 Blues Classic Rock Cover Music Jazz Jukebox Live Concerts Oldies Pop R&B Rock Top 40
Cuisine: All Deitary Needs American Asian Burgers Dessert Menu Fish fresh Salad Grill Homemade Pastry Jamaican Kids Menu Meat Mexican MSG Free Pizza Salad Seafood Soul Food Southwestern Specialty Sandwhich Take out Vegetarian Wings
Amenities Arcade Games Bachelor/ette Party Specials Bands Birthday Parties Children's Menu Darts Dine in / Take out DTV Family Friendly Full-Service Bar Gift Cards Grooms Dinners Happy Hour Jukebox Live Music NFL Sunday Ticket Outdoor/Patio Private Party Pull tabs Receptions/wedding Take Out TV Wi-Fi
Music: Blues House Live Music Rock Top 40
Cuisine: American Buffet Cafeteria Style Mexican Pizza Seafood Soup Steaks Subs Vegetarian
Amenities Bachelor/ette Party Specials Big Screen TV Birthday Parties Brunch Brunch Specials Catering Family Friendly Happy Hour Live Music Outdoor/Patio Receptions/wedding Restaurant Employee Hospitality Specials Wi-Fi
Music: Blues Classic Rock House Jazz Jukebox Live Music R&B Top 40
Cuisine: American Pizza Soup Take out
Amenities Arcade Games Bachelor/ette Party Specials Banquet Big Screen TV Birthday Parties Darts Family Friendly Happy Hour Jukebox Live Music Other Outdoor/Patio Pool Tables Pull tabs Receptions/wedding Take Out Texas Hold'em Wi-Fi
Music: Blues Cajun Music Country Dinning Music Jazz Live Music Rock
Cuisine: American Burgers Chicken fresh Salad Pizza Salad Seafood Soup Vegetarian
Amenities Banquet Bar Bingo Big Screen TV Bingo Birthday Parties Brunch Catering Dancing Dart Tournaments Darts Family Friendly Full-Service Bar Happy Hour Karaoke Meeting Room Meetings Outdoor/Patio Private Party Progressive Bango Pull tabs Receptions/wedding Take Out Trivia Wi-Fi
Music: 80's Alternative Blues DJ Eclectic Jazz Latin Live Music Piano R&B Reggae Rock Salsa
Cuisine: American Italian Mexican Modern Comfort Food Pizza Salad Seafood Soup Steaks Tapas Vegetarian
Amenities Banquet Big Screen TV Birthday Parties Brunch Brunch Specials Catering Featured Hotspots Happy Hour Karaoke Live Music Outdoor/Patio Receptions/wedding Satellite TV Trivia Wi-Fi
Music: Acoustic Alternative Blues Jazz Reggae Rock
Cuisine: American Pizza Take out
Amenities Arcade Games Big Screen TV Darts Karaoke NFL Sunday Ticket Outdoor/Patio Take Out Wi-Fi
Music: Blues DJ Jukebox Top 40
Cuisine: American Italian Pizza Salad Bar Soup Steaks Take out Vegetarian
Amenities Banquet Big Screen TV Birthday Parties Brunch Family Friendly Happy Hour Jukebox Live Music Receptions/wedding Reservations Accepted Take Out Trivia Wi-Fi
Music: Blues DJ Jazz Jukebox Live Music R&B Rock
Cuisine: American cater in food Italian Pizza Subs
Amenities Arcade Games Banquet Big Screen TV Birthday Parties Cards Dance Lessons Dancing Darts Family Friendly Featured Hotspots Foosball Jukebox Live DJ Live Music Outdoor/Patio Pool Tables Receptions/wedding TV Wi-Fi
Music: Acoustic Alternative Blues Eclectic Folk Industrial Jazz Latin Live Music Oldies R&B Salsa
Cuisine: American Deli Muffins Pizza Soup Subs Vegan Vegetarian
Amenities Birthday Parties Brunch Comedy Family Friendly Live Music Open Mic/Amateur Night Wi-Fi
Music: Blues Country Live Music R&B Rock
Cuisine: American Breakfast Mexican Pizza Soup Steaks Vegetarian
Amenities Bachelor/ette Party Specials Big Screen TV Birthday Parties Brunch Catering Family Friendly Happy Hour Live Music Outdoor/Patio Pool Tables Pool Tournaments Pull tabs Receptions/wedding Wi-Fi
1 - 11 of 11 Results |