completely understanding records lists and where to learn more

5 posts by 3 authors in: Forums > CMS Builder
Last Post: October 12, 2011   (RSS)

By rez - October 12, 2011 - edited: October 12, 2011

list($myRecords, $myMetaData) = getRecords(array(
'tableName' => 'my_table',
));

I know a variable is a container for info. An array is a list of values, each having an index. I remember they can get more complex with like, multiple values in each position. I've seen database tables and can look at some mySQL and sort of get what's happening. I understand the for each loops.

I want to understand what the results of the above list looks like exactly. Its an array, right? Or a list like here: http://php.net/manual/en/function.list.php ? I dont get the php list in the manual or how it is whats above. I know how to show all of the contents with the foreach generated code or a certain number of its contents with a counter. But if i could visualize the structure of what I am accessing, I think it may help me remember how this all works and what to learn next from other sources like the php site. ? Or is it CMSB code in there?

I know that myTable is the db table but only guess that $myRecords and $myMetaData are variables that this "list" constructor is populating from this table. Then I loop it out for display. I just don't get what it's putting into each of these variables, how it knows what to put in and what the final result looks like before I access it and where you are getting the more advanced code to manipulate it. The myMetaData is position markers or something? Is it used once when getting to the page to populate $myRecords (we never reference it in the dipslay?)

We display the results with foreach loops and each result can have a name, title, description and a bunch of pictures... so the list must be a list of arrays for each record? That could get complicated.

Hoping to understand this. And what do you recommend I look into next to get more advanced with CMSB past the documentation? Arrays and basic mySQL? Seems like whenever you lose me on answers or go outside the documentation, you are using those things? The line where CMSB ends and PHP and mySQL begins has been been blurry for me. Is CMSB a bunch of functions and in between your code and the display are these lists?

thanks.

Re: [rez] completely understanding records lists and where to learn more

By gkornbluth - October 12, 2011

Hi Rez,

Three suggestions.

One is to look for answers to questions here in the forum. The more specific the better.

The second is to explore my CMSB Cookbook thecmsbcookbook.com for more on how to accomplish various advanced tasks.

The third would be to do exactly what you've done here. Post specific questions on the forum.

Hope that gives you some ideas.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] completely understanding records lists and where to learn more

By rez - October 12, 2011

Thanks Jerry. I look for answers in the forum all the time. I also have your cookbook. I'm trying to put the missing pieces together. I'm doing too much that works and only basically understanding what's going on. I used to work at a micro lab where everyone just followed the procedures. I took home the manuals and a medical dictionary to understand the inner workings of all the machines. Eventually people were coming to me for answers when things went wrong and I advanced quickly as the problem solver for situations in other labs / states.

Although I dont want to solve everyone elses problems here and will never match people like Jason, I want to learn more and understand the inside of the machine. Maybe then i'll know exactly what PHP and mySQL to learn? Where is my manual to cross reference with the PHP site or a Lynda tutorial? I feel like i could watch a lynda tutorial on PHP and mySQL but it still may not apply exactly to where i should go next here?

Re: [Jason] completely understanding records lists and where to learn more

By rez - October 12, 2011

Definitely clarifies things for me a bit more and what to look into next. I was completely backwards on some things and wasn't even totally clear that getRecords was a CMSB function and list was in the PHP manual.

I'll check out those showme functions. Thanks for the direction.