Pulling select fields from records

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

Without resorting to straight SQL, how can you pull only specified fields from tables?

Normally, it would be something like:
SELECT title FROM <table>....

I can't see anyway to limit the fields that are selected using the commands that are accepted by CMS Builder.

Help?
WebCamp One, LLC



Websites That Work

Re: [Mr Jim] Pulling select fields from records

By Jason - December 16, 2010

Hi,

There isn't an option to limit the fields being returned by getRecords. The quickest way to do this would be to just use straight sql.

If you're interested, we can accomplish this for you with some customization.

Can you give an example where you would need to limit the number of fields returned without using plain sql?

Let me know.
Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] Pulling select fields from records

I am creating a website for a property management company. Each property has a LOT of fields. Using the CMS, I have a script that creates the main navigation on the fly by reading the entries to my main navigation table. At one point, I want it to jump into the properties table and just grab the 'title' and record number fields of each of the properties so that I can construct a link to each of them in a drop down menu off the main menu. In this example, it doesn't make sense to have to read in the entire properties table just to grab two fields.

As you said, I'll probably just go ahead and write this using regular sql.
WebCamp One, LLC



Websites That Work

Re: [chris] Pulling select fields from records

By MisterJim - December 16, 2010 - edited: December 17, 2010

Thanks, Chris. That worked like a charm.

Jim
WebCamp One, LLC



Websites That Work