AllToolKits.com Posted October 29, 2015 Report Posted October 29, 2015 Hi, I have to call a table i created from the function public function getAdminServiceInfo I tried below code $this->components(array("Record")); $cron_log = $this->Record->select()-> from("my_table")-> fetchall(); Seems like that is not working. This table can't be part of the module, so i need a way to query the table. Let me know how i can do it? i recall someone told to use plugin for calling custom tables, but i can't use plugin as i need to call the table data from module function getAdminServiceInfo. Please let me know how i can do it. Quote
0 Tyson Posted October 29, 2015 Report Posted October 29, 2015 The Record component may not be connecting to the database, or because of some other error, perhaps because you're calling "fetchall" rather than "fetchAll". A plugin could be created that defines a model and method that performs the query, and then your module can call that plugin's model method to fetch the data. Using a plugin also allows you to better define the creation and removal of your database tables. You could also setup your module to not install itself if the associated plugin dependency is not installed first. Quote
Question
AllToolKits.com
Hi,
I have to call a table i created from the function public function getAdminServiceInfo
I tried below code
Seems like that is not working. This table can't be part of the module, so i need a way to query the table.
Let me know how i can do it?
i recall someone told to use plugin for calling custom tables, but i can't use plugin as i need to call the table data from
module function getAdminServiceInfo. Please let me know how i can do it.
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.