Location: PHPKode > projects > phpDocMaker > Utils/sqlConnect.php
<?
	// functions to manage mysql connection

if (!isset ($sqlConnect))
{
	$sqlConnect = 1;

	function doConnection ()
	{

		$connection = mysql_pconnect (SERVER, NAME, PASSWORD);

		if (!$connection)
		{
			echo "Conection refused to " . SERVER . " server\n";
			exit;
		}

		if (!mysql_select_db (DB, $connection))
		{
			echo "Acces denied to " . DB . " database\n";
			exit;
		}

		return $connection;
	}

	function ExecRequest($request,$connection)
	{
		global $debugSQL;

        if ($debugSQL)
			echo "<br>$request<br>";

		$result = mysql_query ($request, $connection);

		if ($result)
		{
			return $result;
		}
		else
		{
			echo "<B> Erreur : " . mysql_error($connection);
			exit;
		}
}


}

?>
Return current item: phpDocMaker