direct access to db & loadFileSet question
Permalink 1 user found helpful
1. is there any easy examples for me to start of where i can easily do a "select * from table_name" query in my model/controller?
http://www.concrete5.org/help/building_with_concrete5/developers/mv...
and
http://phplens.com/lens/adodb/docs-active-record.htm...
don't explain much
2. Needed to load files in a certain set, google search points me to loadFileSet() which was broken in v5.3.0 and fixed later. Any explanation and/or example on how to use that function?
Thank you
http://www.concrete5.org/help/building_with_concrete5/developers/mv...
and
http://phplens.com/lens/adodb/docs-active-record.htm...
don't explain much
2. Needed to load files in a certain set, google search points me to loadFileSet() which was broken in v5.3.0 and fixed later. Any explanation and/or example on how to use that function?
Thank you
$db = Loader::db();
This will give you a database object that all the ADODB commands in your reference will work on. So, for example
$foo = $db->GetAll('select col1, col2, col3 from mytable where myid = ?', array($myID));
will give you an associative array of all rows from the mytable table where myid is a certain value.
2. There really isn't a good way to get files in a file set via a public API. If you really need a solution you can check blocks/slideshow/controller.php to see how our tables are structured, but in the future we will offer a much cleaner way through the API to get it (rather than querying the table directly with SQL).