> That returns a record, not one string, right?
if you need a string, write a model method to return it:
// Function in a model or AppModel if required application wide
function findFieldValue($field, $conditions=array())
{
if (isset($field) && !empty($condistions))
{
if ($record = $this->find('first',
array('conditions'=>$conditions)))
{
return $record[$this->alias][$field];
}
}
}
// called in controller
$single_field_value_of_record_1 =
$this->Model->findFieldValue('single_field', array('id'=>1));
hth
jb
--
jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---