Fork me on GitHub

Help... tables and column missing from $pntable  Bottom

  • Hi! I need some help...

    Here's the content of my pntables.php

    function test_pntables()
    {
    $pntable = array();

    $tableName = pnConfigGetVar('prefix') . '_test';

    $pntable['test'] = $tableName;

    $pntable['test_column'] = array('recordid' => $tableName . '.recordid');

    return $pntable;
    }

    And the partial content of my pninit.php

    function test_init()
    {
    // Reference database connection
    $dbconn =& pnDBGetConn(true);

    // Reference pnTable from PostNuke core array
    $pntable =& pnDBGetTables();

    print_r($pntable);
    die();

    The table ($pntable['test']) and column ($pntable['test_column']) I specify in pntables.php is not in the $pntable array! Where did I go wrong? Please help!

    -Ang
  • Upon further investigation by inserting die() in pntables.php, I realized it was never called. icon_frown I have made sure display_error is on and error_reporting is E_ALL. Where do I go from here?

    -Ang
  • in your test_init() function, after defining $pntables, do this:

    $testtable = &$pntable['test'];
    $testcolumn = &$pntable['test_column'];

    That should work.
  • Thanks for the suggestion. After one week of reading up all the documents and posting I can find, I finally found the answer at the PostNuke Modules Factory (http://home.postnuke.ru/index.php/).

    Quote


    Do I have proper permissions for module's files (0644) and directories (0755)?


    I am trying out the new Ubuntu and the file permission wasn't set correctly. PostNuke was unable to 'read' pntables.php.

    :)

This list is based on users active over the last 60 minutes.