Location: PHPKode > scripts > Handle remote data with PHP 5 and REST Web service > handle-remote-data-with-php-5-and-rest-web-service/server/classes/serverDBconn.class.php
<?php

class ServerDBConn {

	protected $dblink;
	
	function connectDB()
	{		
		$this->dblink  = mysqli_init();
		@$this->dblink->real_connect('localhost', 'root', '', 'db_restservice');
		if (mysqli_connect_errno()) {
			die("<font size=\"2\" color=\"red\" face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\">
								Access denied.</font>"); }		
    		return $this->dblink;
	}

}
?>
Return current item: Handle remote data with PHP 5 and REST Web service