<?php
/*
* Db.php : Data base magnament class.
* WebSlider
* (c) 2004 Marco Antonio Islas Cruz
* <markuz@islascruz.org>
*/
class db
{

	function connect($host,$username,$password)
	{
		if (!mysql_connect($host,$username,$password))
			$GLOBALS["functions"]->fatal_error("I can't Connect to database");
	}
	function fetch_array($sql)
	{
		if($query = mysql_query($sql))
			return mysql_fetch_array($query);
		else
			$GLOBALS["functions"]->fatal_error(mysql_error());
	}
	
	function fetch_row($sql)
	{
		$query = mysql_query($sql);
		while ($d = mysql_fetch_row($query))
			$data[]=$d[0];
		return $data;
	}
	
	function query($sql)
	{
		if (mysql_query($sql))
			return 1;
		else
			return 0;
	}
}
?>