Location: PHPKode > projects > Chalange > com_chalange/Tables/players.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePlayers extends JTable{
	var $id=null;
	var $nroLicence=null;
	var $codUCI=null;
	var $name=null;
	var $surname=null;
	var $birthday=null;
	var $address=null;
	var $province=null;
	var $telephone=null;
	var $email=null;
	var $idcategory=null;
	var $club=null;
	var $sponsor=null;
	var $country=null;
	var $_db=null;
	function __construct(&$db){
		parent::__construct('#__gcd_players','id',$db);
		$this->_db=& $db; 
		
	}
	function store($post){
		//echo "menuda mierda";
		if (!parent::store($post)) return -1;
		if (empty($post['id'])){ // se trata de una inserción
			echo "post vacio";
			$resultSet=$this->_db->execute("SELECT MAX(id) as id FROM #__gcd_players");
			$auxilier=$resultSet->FetchRow();
			if (!empty($auxilier)) return $auxilier[0];
			else return -1;
			echo $resultSet->RecordCount();
		}
		else return $post['id'];
	}
}
?>
Return current item: Chalange