<?php
/* This class will be used for common data base operations such as 
 connect, add, modify, delete, find data and database
*/

	class dboperations_members
	{
		var $connection;
		var $db;
		
		// constructor
		function __construct()
		{
		
		}
		
		function dbconnect()
		{
			$connect = mysqli_connect(DB_HOST, DB_USER, DB_PASS,DB_NAME) or die("could not connect to server1");
			
			$this->connection = $connect;
			
			// Selecting the Database for use 
			$db_select = mysqli_select_db($this->connection,DB_NAME) or die("could not select the database"); 
		
			$this->db = $db_select;
		}
		function dbdisconnect()
		{
		
		}
		function select_query($sqltext,$print="")
		{
			$query = $sqltext;
			$result = ($print == "")?mysqli_query($this->connection,$query):$query;
			return $result;
			mysqli_close($this->connection);		
		}
		function insert_query($sqltext,$print="")
		{
			$query = $sqltext;
			$result = ($print == "")?mysqli_query($this->connection,$query):$query;
			return $result;
			mysqli_close($this->connection);	
		}
		function update_query($sqltext,$print="")
		{
			$query = $sqltext;
			$result = ($print == "")?mysqli_query($this->connection,$query):$query;
			return $result;
			mysqli_close($this->connection);	
		}
		function delete_query($sqltext,$print="")
		{
			$query = $sqltext;
			$result = ($print == "")?mysqli_query($this->connection,$query):$query;
			return $result;
			mysqli_close($this->connection);	
		}
		function numRows($result)
		{
			$rows = @mysql_num_rows($result);
			if ($rows === null) 
			{
				return $this->mysqliRaiseError();
			}
			return $rows;
		}
		function mysqliRaiseError($errno = null)
		{
			
		}
		
	
	}
	
?>