Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
htdocs(root)-Myproject/data access/da_admin.php


$base = $_SERVER['DOCUMENT_ROOT'];
include_once($base.DIRECTORY_SEPARATOR.'status_codes.php');
include_once($base.DIRECTORY_SEPARATOR.'data-access'.DIRECTORY_SEPARATOR.'connection.php');

function db_get_client_master_list($active)
{
	// Base Query
	$client_squery_base = "select * from client_master";
	
	// Where query
	$client_squery_where = "";
	
	// Data
	$client_sdata = array();
	
	$filter_count = 0;

	if($active != "")
	{
		if($filter_count == 0)
		{
			// Query
			$client_squery_where = $client_squery_where." where client_active=:active";								
		}
		else
		{
			// Query
			$client_squery_where = $client_squery_where." and client_active=:active";				
		}
		
		// Data
		$client_sdata[':active']  = $active;
		
		$filter_count++;
	}
	
	$client_squery = $client_squery_base.$client_squery_where;
	
	try
	{
		$dbConnection = get_conn_handle();
		
		$client_sstatement = $dbConnection->prepare($client_squery);
		
		$client_sstatement -> execute($client_sdata);
		
		$client_sdetails = $client_sstatement -> fetchAll();
		
		if(FALSE === $client_sdetails)
		{
			$return["status"] = FAILURE;
			$return["data"]   = "";
		}
		else if(count($client_sdetails) <= 0)
		{
			$return["status"] = DB_NO_RECORD;
			$return["data"]   = "";
		}
		else
		{
			$return["status"] = DB_RECORD_ALREADY_EXISTS;
			$return["data"]   = $client_sdetails;
		}
	}
	catch(PDOException $e)
	{
		// Log the error
		$return["status"] = FAILURE;
		$return["data"] = $e->getMessage();
	}
	
	return $return;
}
?>

I want to call this function inside Myproject.How can I Do this?Please help me?
Posted
Updated 21-Nov-14 1:19am
v2

1 solution

You should use include or require...

See this: W3SCHOOLS - INCLUDE AND REQUIRE[^]

According to ur question use:

PHP
include 'PATH/TO/da_admin.php';

db_get_client_master_list('PARAM');
?>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900