Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
database field prefix
  • Posted: 27.07.2005, 06:36
     
    thowden
    rank:
    Helper Helper
    registered:
     November 2002
    Status:
    offline
    last visit:
    30.07.08
    Posts:
    117
    Hi All

    Is there a requirement for database fields to be prefixed with 'pn_' for API compliance ?

    I looked in the doc's library but the main docs like the API Guide and Coding Standards have broken links.

    Is there a new location for these doc's ?

    --
    cheers
    Tony

    Marble Bay : PostNuke Dev Work
    Wren/Maxwell : PostNuke Hosting

  • Posted: 27.07.2005, 06:44
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    offline
    last visit:
    01.12.08
    Posts:
    6534
    They should use the defined prefix from the install, not so much for API complaince but for organization incase someone is using one DB for multiple scripts, they can see anything starting with pn_ or nuke_ or whatever the prefix chosen upon installation is for PostNuke.
  • Posted: 27.07.2005, 07:49
     
    thowden
    rank:
    Helper Helper
    registered:
     November 2002
    Status:
    offline
    last visit:
    30.07.08
    Posts:
    117
    Hi

    Thanks. I think you are referring to the table names which I understand use the prefix of pn_ (or nuke_ in earlier versions) from the installation process.

    What I am wondering about are the actual field names inside the table or are you saying that these are also set by the same variable from the install ?

    --
    cheers
    Tony

    Marble Bay : PostNuke Dev Work
    Wren/Maxwell : PostNuke Hosting

  • Posted: 27.07.2005, 14:02
     
    Simon
    rank:
    Steering Committee Steering Committee
    registered:
     December 2002
    Status:
    offline
    last visit:
    28.11.08
    Posts:
    13417
    The table prefix should be set with pnConfigGetVar('prefix'). As for each individual column I don't believe it matters.

    --
    Regards,
    Simon

    itbegins.co.uk - Zikula Consulting

    Please read the Support Guide
  • Posted: 28.07.2005, 02:58
     
    thowden
    rank:
    Helper Helper
    registered:
     November 2002
    Status:
    offline
    last visit:
    30.07.08
    Posts:
    117
    Thanks Simon.

    Just for reference:

    Code

    $prefix = $GLOBALS['pnconfig']['prefix'];

    or

    Code

    $prefix = pnConfigGetVar('prefix');


    I am working on the basis that the former is the old way and the pnConfigGetVar is the current method, ie .76xxx.

    When looking at the pnConfigGetVar function it's obvious that the former is still used just via this function. As a result either method should work, but I should change my old code.

    Thanks again.

    --
    cheers
    Tony

    Marble Bay : PostNuke Dev Work
    Wren/Maxwell : PostNuke Hosting

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula