english/administrator/components/com_aicontactsafe/models/fields.php
// function check if the field name is used on the database for a different field
function check if the field name is used on the database for a different field
function check if the field name is used on the database for a different field
function nameUsed( $checkName = '', $checkId = 0) {
		$db = & JFactory::getDBO();
		$query = 'select count(*) as count_fields from #__aicontactsafe_fields where name = \'' . $checkName . '\' and id != ' . (int)$checkId;
		$db->setQuery($query);
		$count_fields = $db->loadResult();
		return $count_fields;
	}
function nameUsed ( $ checkName = '' , $ checkId = 0 ) { $ db = & JFactory :: getDBO ( ) ; $ query = 'select count(*) as count_fields from #__aicontactsafe_fields where name = \'' . $ checkName . '\' and id != ' . ( int ) $ checkId ; $ db -> setQuery ( $ query ) ; $ count_fields = $ db -> loadResult ( ) ; return $ count_fields ; }
function check if the field name is used on the database for a different field
function check if the field name is used on the database for a different field
// initialize different variables // count all the fileds with the same name and a different id