Discussion in 'Customization & add-ons' started by mlurie, Feb 7, 2008.

  1. mlurie

    mlurie New Member

    Dec 31, 2007
    Hi, I am trying to create a function in the file that uses the $db->get_payments($payment_id); hook. But when I try to use this hook according to the amember manual, I get the error message: "Fatal error: Call to undefined function setup_plugin_hook() in /home/wikicook/public_html/amember/ on line 21"

    I am getting the error message when I type directly into the browser. I know the error means that the code doesn't interpret $db as an object. But I declared 'global $db;' like the amember manual told me to so I don't know why it isn't.

    Any help would be appreciated!

    I have copied the function below - this is the complete code of the file.


    function get_active_member_array(){
    //this function assumes users can only subscribe to one product at a time.

    global $db;

    $active_member_array =
    $db->query($sql= "SELECT member_id
    FROM {$db->config[prefix]}members
    WHERE status = '1'
    ORDER BY member_id"); //This statement begins on line 21, which the error message refers to.

    return $active_member_array;

    //Testing the Function by printing the member array:
    $member_array =

    echo "active member array:<br>";
    echo "<pre>";
    echo "</pre>";


Share This Page