Hi guys, looking for help with a sticky one.
Haven't been here in awhile but I know you can help.
I have a locations page listing where I've divided the listings up by the state selection in the record.
I also only want to show the individual locations that have a (finance) link.
My code looks like this:
list($southcarolinalocationsRecords, $locationsMetaData) = getRecords(array(
'tableName' => 'locations',
'allowSearch' => false,
'debugSql' => true,
'where' => "state = 'south carolina' AND financing_application_link = '1'",
));
list($northcarolinalocationsRecords, $locationsMetaData) = getRecords(array(
'tableName' => 'locations',
'allowSearch' => false,
'where' => "state = 'north carolina'",
));
And the HTML here:
<h3>South Carolina Locations:</h3>
<?php foreach ($southcarolinalocationsRecords as $record): ?><div class="location"><h4><?php echo $record['location_name'] ?></a></h4>
<p><?php echo $record['address'] ?><br />
<?php echo $record['city_st_zip'] ?><br/>
<?php echo $record['contact_info'] ?></p>
<p><a href="<?php echo $record['financing_application_link'] ?>" target="_blank" title="<?php echo $record['location_name'] ?>">Apply Online</a></p>
</div><?php endforeach ?>
<hr/>
<h3>North Carolina Locations:</h3>
<?php foreach ($northcarolinalocationsRecords as $record): ?><div class="location"><h4><?php echo $record['location_name'] ?></a></h4>
<p><?php echo $record['address'] ?><br />
<?php echo $record['city_st_zip'] ?><br/>
<?php echo $record['contact_info'] ?></p>
<p><a href="<?php echo $record['financing_application_link'] ?>" target="_blank" title="<?php echo $record['location_name'] ?>">Apply Online</a></p>
</div><?php endforeach ?>
<hr/>
Problem I am having is the South Carolina locations do not show at all.
Of course the North Carolina locations show, regardless of if they have the link or not. I haven't added this yet: AND financing_application_link = '1'",
Once I do, both sections go blank.
At least it divides up the locations listings!
Right now, the South Carolina listings are blank.
The debug message reads:
SELECT SQL_CALC_FOUND_ROWS `locations`.*
FROM `cms_locations` as `locations`
WHERE (state = 'south carolina' AND financing_application_link = '1')
ORDER BY dragSortOrder DESC
Help please.
:- /