For example, this worked for me:
<?php
$result = rrd_fetch( "mydata.rrd", array( "AVERAGE", "--resolution", "60", "--start", "-1d", "--end", "start+1h" ) );
?>
This will fetch all fields. You then have to use something like this to get to a specified rrd field:
<?php
foreach ( $result["data"]["myfield"] as $key => $value )
{
echo "At timestamp $key, the value for myfield is $value.\n";
}
?>