
Originally Posted by
mikeel100
I need to retrieve the
configuration_group_id to do my inserts into the configuration table. Here is what worked in 1.5.6c:
Code:
$setup_gID = $db->execute("select `configuration_group_id`
from " . TABLE_CONFIGURATION_GROUP . "
where `configuration_group_title` = 'EZ-Feeds Settings' ");
if(isset($setup_gID->fields['configuration_group_id'])) {
$gID_setup = $setup_gID->fields['configuration_group_id'];
}
if this worked in v156c, i see no reason why it would not work in v157. perhaps i would do:
PHP Code:
//from
if(isset($setup_gID->fields['configuration_group_id'])) {
//to
if(!($setup_gID->EOF) {
Unfortunately, I have no experience with working with php classes. I have read tons of how to pages but nothing is sinking in or working for me.
I have tried various forms of this (from configuration.php):
Code:
$gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("SELECT configuration_group_title
FROM " . TABLE_CONFIGURATION_GROUP . "
WHERE configuration_group_id = " . (int)$gID);
It returned 1, instead of 31, in one of my attempts...
i am not sure what 'it' refers to.
this code has little to do with classes. i would suggest studying a little more on php. your first line creates a var named $gID. if there is $_GET['gID'], $gID gets assigned that value, else it gets assigned 1. the second line assigns the $_GET['gID'] var to what $gID is. it makes no sense to me.
do you understand _GET vars? i would suggest reading about them. it is the way to pass data from a URL. reassigning it makes no sense (to me) in this context.
so I tried various forms of this:
Code:
$gID_setup =
"select `configuration_group_id` from " . TABLE_CONFIGURATION_GROUP . "
where `configuration_group_title` = 'EZ-Feeds Settings' ";
$this->executeInstallerSql($gID_setup);
var_dump($this->gID_setup);
exit;
NULL was returned in one instance and bool(true) in another.
i normally use something called print_r as opposed to var_dump. but now we are into a class.... and executeInstallerSql will only return true or false. i have no idea what this might be: `$this->gID_setup`.
i agree that the zc_plugins is a GREAT addition to ZC. but the problems that you are having are more related to your understanding of php than anything special about ZC. IMO.
not sure that helps.... but keep trying!
Bookmarks