- Moderated by:
- Support
-
- rank:
-
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
-
- rank:
-
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. -
- rank:
-
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
-
- rank:
-
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 -
- rank:
-
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
