Odd problem - not retrieving any records

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 16, 2010   (RSS)

By garyhoffmann - June 16, 2010

I have a table of records in which no records are being read using the getRecords code.

First, let me start by mentioning I do not have any publish/remove dates, hidden flags or anything like that on this section.

Here is some code from the header. I've included a second table in which I'm getting records no problem

list($coursesRecords, $coursesMetaData) = getRecords(array(
'tableName' => 'courses',
));
print_r($coursesRecords);
$coursesRecord = $coursesRecords[0]; // get first record

//get all of the instructors - if we are displaying instructors, we will loop thru for each one
list($instructorsRecords, $instructorsMetaData) = getRecords(array(
'tableName' => 'instructors',
));
print_r($instructorsRecords);

The instructors print no problem, the course I'm not getting anything.

I'm also getting back records for several other tables, so I'm a bit confused as to what this could be.

Is there a "debugging" mode such that I can see what's going on in getRecords?

Thanks,
Gary.

Re: [garyhoffmann] Odd problem - not retrieving any records

By Chris - June 16, 2010

Hi Gary,

Can you please post the complete PHP source code for your page, as well as a description of (or link to) what the results are?

Does nothing print for print_r($coursesRecords)?

There is a debugging mode which shows you the SQL generated for your getRecords call. I'm not sure it'll help, but you can always try it:

list($coursesRecords, $coursesMetaData) = getRecords(array(
'tableName' => 'courses',
'debugSql' => true,
));

All the best,
Chris