[nycphp-talk] Help with a CakePHP View
Randal Rust
randalrust at gmail.com
Thu Apr 30 14:46:00 EDT 2009
On Thu, Apr 30, 2009 at 2:37 PM, Daniel Convissor
<danielc at analysisandsolutions.com> wrote:
>> $whereClause = '`District`.`id` = "' .
>> $this->mrClean->sql($this->passedArgs[0]) . '"';
>> $this->set('district', $this->District->find($whereClause));
> I'll bet you a beer that it's because there's no record in the database
> with a matching record. So that means either $this->passedArgs[0] isn't
> being set or is set to a value that doesn't equal a value in the
> District.id column of the table.
You owe me a beer:)
I've checked all of that. What's even more strange is that I found out
that for 3 of the 20 records the view will actually work. The others,
no luck. I have tried all sorts of options on this and simply cannot
discover why the view fails in most cases. I even tried this:
$this->District->findById(35); //which works
$this->District->findById(141); //which fails
However, if I do this:
$this->District->query("select * from districts as District where id='35'");
or:
$this->District->query("select * from districts as District where id='141'");
Both of those work, but it gives me the data in an array that doesn't
work with the data structure that has been set up.
--
Randal Rust
R.Squared Communications
www.r2communications.com
614-370-0036
More information about the talk
mailing list