Location: PHPKode > projects > RabbitBB - Online Web Storage Project > mywebdrive/PHP_CON/file/DAOAddDirIndex.php
<?PHP

class DAOAddDirIndex
{
	var $db;
	var $db_table;
	var $db_field;

	function DAOAddDirIndex()
	{
		global $db, $db_table, $db_field;
		$this->db = $db;
		$this->db_table = $db_table;
		$this->db_field = $db_field;
	}

	function addindex($_filenamearr, $_fid)
	{
		for ($i=0; $i<count($_filenamearr); $i++)
		{
			$sqlq = "INSERT INTO ".$this->db_table['dirindex'].
				" (`dirname`, `totalword`, `fileid`) ".
				"VALUES ('".$_filenamearr[$i]."',".
				count($_filenamearr).",".$_fid.")";
			if (!$this->db->sql_query($sqlq))
				return false;
		}
		return true;
	}	

	function rollback()
	{
		$this->db->sql_query("", ROLLBACK);
	}

	function commit()
	{
		$this->db->sql_query("", END_TRANSACTION);
	}

}

?>
Return current item: RabbitBB - Online Web Storage Project