data_read( array( "table_name" => "versions", "index_name" => "application", "index_value" => $application_name ) ) ) return $version["version"]; return false; } public function set_version($application_name, $version){ if( ( $data_version = $this->data_read( array( "table_name" => "versions", "index_name" => "application", "index_value" => $application_name ) ) ) === false ){ return false; } if($data_version){ if( !$this->data_update( array( "table_name" => "versions", "index_name" => "id", "index_value" => $data_version["id"], "values" => array( "version" => $version ) ) ) ){ return false; } } else{ if( !$this->data_insert( array( "table_name" => "versions", "values" => array( "application" => $application_name, "version" => $version ) ) ) ){ return false; } } return true; } }