- Moderated by:
- Support
-
- rank:
-
Freshman
- registered:
- February 2006
- Status:
- offline
- last visit:
- 15.09.06
- Posts:
- 28
Greetings, I am writing a module that needs the user's id from the pnuser table. I would like to create a foreign key for my tables but I would need to know the proper way to get the pnuser table name that accounts for changes in table prefix and so on. Essentially I need the pntables result for the user module. How do I get that ?
I would look it up on the API reference but that seems to have VANISHED! :(
TIA. -
- rank:
-
Steering Committee
- registered:
- August 2002
- Status:
- offline
- last visit:
- 03.03.08
- Posts:
- 1221
In 762... using
Code
$pntable = pnDBGetTables();
Will get you the user table information
Code
$usertbl = $pntable['users'];
$usercol = $pntable['users_column'];
In 0.8, you'll need a
Code
pnModDBInfoLoad('Users');
The users table will then be available the same way.
As you said, having your table name hardcoded is bad, if you are building a module, you should have a pntables.php.
--
Chestnut !
Support via Private message won't be answered...
http://dev.pnconcept.com
http://www.postnuke-france.org
