ars_GetEntry(ctrl,schema,entry_id,...)

This function returns a hash (associative array) of field ids and values for a given schema and entry id. If you specify any field ids after the entry_id parameter, only the values for those fields will be returned, otherwise all field id value pairs are returned. All field values are converted into numeric or string values, except for the diary type. The diary field type is encoded as an array of hashes. Each hash has a timestamp, user and value field.

On success
Returns a hash. The keys of the hash are the field ids and the values are the field values.
On failure
Returns undef.

Example:

      (%f = ars_GetFieldTable($c, "User")) || die $ars_errstr;
      (%vals = ars_GetEntry($c, "User", $entry_id)) || die $ars_errstr;
      print "Login name = ".$vals{$f{"Login name"}}."\n";
      

Example of decoding a diary field:

      $diaryfield_fid = ars_GetFieldByName($ctrl, $schema, $diaryfield);
      %vals = ars_GetEntry($ctrl, $schema, $entry_id, $diaryfield_fid);

      foreach $diary_entry (@{$vals{$diaryfield_fid}}) {
        print "$diary_entry->{timestamp}\n";
	print "$diary_entry->{user}\n";
        print "$diary_entry->{value}\n";
      }
      
See Also: Diary Entry Hash Values and Attachment Hash Values


<-- Table of Contents

Last changes to this page 26th June 1997 by d.j.adams@soton.ac.uk
© J.C.Murphy, J.W.Murphy 1997 arsperl@arsperl.org