the table and column names wont come up, any help?
// Get datbase setup - note that both pnDBGetConn() and pnDBGetTables() // return arrays but we handle them differently. For pnDBGetConn() // we currently just want the first item, which is the official // database handle. For pnDBGetTables() we want to keep the entire // tables array together for easy reference later on $dbconn =& pnDBGetConn
(true);
$pntable =& pnDBGetTables
();
// It's good practice to name the table and column definitions you // are getting - $table and $column don't cut it in more complex // modules $approvaltable = &
$pntable['approval'];
$approvalcolumn = &
$pntable['approval_column'];
$userstable =
$pntable[users
];
$userscolumn = &
$pntable['users_column'];
$grouptable = &
$pntable['group'];
$groupcolumn = &
$pntable['group_column'];
// All variables that come in to or go out of PostNuke should be handled // by the relevant pnVar*() functions to ensure that they are safe. // Failure to do this could result in opening security wholes at either // the web, filesystem, display, or database layers. list($gid,
$uid) = pnVarPrepForStore
($gid,
$uid);
// Get next ID in table - this is required prior to any insert that // uses a unique ID, and ensures that the ID generation is carried // out in a database-portable fashion $userid =
$dbconn->
GenId($usertable);
$sql =
"INSERT INTO $usertable ($usercolumn[name],
$usercolumn[uname],
$usercolumn[email],
$usercolumn[femail],
$usercolumn[url],
$usercolumn[user_avatar],
$usercolumn[user_regdate],
$usercolumn[user_icq],
$usercolumn[user_occ],
$usercolumn[user_from],
$usercolumn[user_intrest],
$usercolumn[user_sig],
$usercolumn[user_viewemail],
$usercolumn[user_theme],
$usercolumn[user_aim],
$usercolumn[user_yim],
$usercolumn[user_msnm],
$usercolumn[pass],
$usercolumn[storynum],
$usercolumn[umode],
$usercolumn[uorder],
$usercolumn[thold],
$usercolumn[noscore],
$usercolumn[bio],
$usercolumn[ublockon],
$usercolumn[ublock],
$usercolumn[theme],
$usercolumn[commentmax],
$usercolumn[counter],
$usercolumn[timezone_offset])
VALUES ('" . pnVarPrepForStore
($item[name
]) .
"',
'" . pnVarPrepForStore
($item[uname
]) .
"',
'" . pnVarPrepForStore
($item[email
]) .
"',
'" . pnVarPrepForStore
($item[femail
]) .
"',
'" . pnVarPrepForStore
($item[url
]) .
"',
'" . pnVarPrepForStore
($item[user_avatar
]) .
"',
'" . pnVarPrepForStore
($item[user_regdate
]) .
"',
'" . pnVarPrepForStore
($item[user_icq
]) .
"',
'" . pnVarPrepForStore
($item[user_occ
]) .
"',
'" . pnVarPrepForStore
($item[user_from
]) .
"',
'" . pnVarPrepForStore
($item[user_intrest
]) .
"',
'" . pnVarPrepForStore
($item[user_sig
]) .
"',
'" . pnVarPrepForStore
($item[user_viewemail
]) .
"',
'',
'" . pnVarPrepForStore
($item[user_aim
]) .
"',
'" . pnVarPrepForStore
($item[user_yim
]) .
"',
'" . pnVarPrepForStore
($item[user_msnm
]) .
"',
'" . pnVarPrepForStore
($item[pass
]) .
"',
'" . pnVarPrepForStore
($item[storynum
]) .
"',
'',
0,
0,
0,
'" . pnVarPrepForStore
($item[bio
]) .
"',
0,
'',
'',
'" . pnVarPrepForStore
($item[commentlimit
]) .
"',
'0',
'" . pnVarPrepForStore
($item[timezoneoffset
]) .
"')";
print_r($sql);
die;
$dbconn->
Execute($sql);
// Check for an error with the database code, and if so set an // appropriate error message and return if ($dbconn->
ErrorNo() !=
0) { pnSessionSetVar
('errormsg', _CREATEFAILED
);
return false;
}