help with a new details page

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 18, 2010   (RSS)

Re: [rentittoday] help with a new details page

By Jason - November 18, 2010

Hi,

It looks like you're pretty close on both of these issues.

1) You'll need to change you're query to look like this:



list($commercial_rental_propertyRecordsByUser, ) = getRecords(array(
'tableName' => 'commercial_rental_property',
'where' => "createdByUserNum ='".intval($commercial_rental_propertyRecord['createdByUserNum'])."' AND num!='".intval($commercial_rental_propertyRecord['num'])."'",
));


The second half of the "where" statement is so you don't select the same record twice. It is important that this query appear after your first query. It is also important to always use new variable names (ie $commercial_rental_propertyRecordsByUser) so you don't overwrite other variables by mistake.

2) It's a similar situation here. You'll need to change your variable name and your query like this:

list($commercial_rental_propertyRecordsByCity,) = getRecords(array(
'tableName' => 'commercial_rental_property',
'where' => "cities_serviced LIKE '%".mysql_escape($commercial_rental_propertyRecord['city'])."%' AND num!='".intval($commercial_rental_propertyRecord['num'])."'",
));


Using "%" before and after the city name means will will return records where the city name appears anywhere in the cities_serviced text. Again we added code so that we won't select the same record twice.

Give this a try and let me know if you run into any issues.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/