NYCPHP Meetup

[nycphp-talk] Help with a CakePHP View

Daniel Convissor danielc at analysisandsolutions.com
Thu Apr 30 15:07:24 EDT 2009


On Thu, Apr 30, 2009 at 02:46:00PM -0400, Randal Rust wrote:
> 
> You owe me a beer:)

Cool!  Hey, double or nothing...


> 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.

So chances are the data inside the table is the problem, not the query.  
Do a very careful comparison of a record that works vs one that doesn't.

A possibility is that the query is doing an (inner) JOIN rather than a 
(outer) LEFT JOIN and there's no matching record in the joined table?

Have you put a debug statement inside the framework at the point just 
before the query is actually sent to the database (you know, like a 
mysqli_query() call)?  That way you can see the SQL the framework has 
composed.  Then you can run that SQL manually and see what comes up.

If that doesn't reveal anything, you'll need to break out a debugger and 
step through the code of a working district id and a non-working district 
id to see what the difference is.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list