<?php
session_start();

$dbhost = "localhost";
$dbusername = "root";
$dbuserpassword = "mysql-n4pht4l1";
$dbname = "myzenith";
$default_sort_order = 'ASC';
// $default_order_by = 'productid';
$records_per_page = 5;
$partners_tablename = 'partners';
$category_tablename = 'categories';
$projects_tablename = 'projects';
$vendors_tablename = 'vendors';
$contacts_tablename = 'vendor_phones';
// $currency_tablename = 'currency';
// $downloads_tablename = 'downloads';
// $admins_tablename = 'admins';
// $admin_memos_tablename = 'admin_memos';
// $public_order_items_tablename = 'public_order_items';
// $public_orders_tablename = 'public_orders';
// $description_tablename = 'descriptions';
// $album_tablename = 'album';
// $album_images_tablename = 'album_images';
// $album_tracks_tablename = 'album_tracks';
// $album_description_tablename = 'album_description';
// $teach_tablename = 'teach';
// $teach_images_tablename = 'teach_images';
// $teach_tracks_tablename = 'teach_tracks';
// $teach_description_tablename = 'teach_description';
// $book_tablename = 'book';
// $book_images_tablename = 'book_images';
// $book_tracks_tablename = 'book_details';
// $book_description_tablename = 'book_description';
$MYSQL_ERRNO = '';
$MYSQL_ERROR = '';
$new_win_width = 800;
$new_win_height = 600;


global $MYSQL_ERRNO, $MYSQL_ERROR;


function sql_error() {
   global $MYSQL_ERRNO, $MYSQL_ERROR;

   if(empty($MYSQL_ERROR)) {
      $MYSQL_ERRNO = mysql_errno();
      $MYSQL_ERROR = mysql_error();
   }
   return "$MYSQL_ERRNO: $MYSQL_ERROR";
}

function error_message($msg) {
   echo "<SCRIPT>alert(\"Error: $msg\");history.go(-1)</SCRIPT>";
   exit;
}

// Function used to Query Database (saves repitious calling of DB)
	//
	function query_db($myquery) {
		// Database Connection Variables
		$dbhost = "localhost";
		$dbuser = "root";
		$dbpass = "mysql-n4pht4l1";
		$dbname = "myzenith";
		
		// Create a new database connection
		$dbconn = mysql_connect($dbhost, $dbuser, $dbpass);
		mysql_select_db($dbname, $dbconn);
		
		// Query Database
		$result = mysql_query($myquery, $dbconn);
			
		// Return the results from the query
		return $result;
		
		// Free the results variable and close the database connection
		mysql_free_result ($result);
		mysql_close ($dbconn);
	}
?>

