rendered paste body/app/models/plan.php
<?php
class Plan extends AppModel
{
var $name = 'Plan';
function find()
{
$ret = $this->query("SELECT Title FROM plans
WHERE id = 1");
$Title = $ret[0]['Title'];
return $Title;
}
}
?>
Database
-- Table structure for table `plans`
--
CREATE TABLE `plans` (
`id` int(10) unsigned NOT NULL auto_increment,
`title` varchar(50) NOT NULL default '',
`body` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `plans`
--
INSERT INTO `plans` VALUES (1, 'Test', 'Test body');