Hey all, i have a custome script here that redirects people to a welcome page the first time the log in to give them an overview of my site. The problem is that i made got this script after i already had 1000 members so the table that is being "UPDATED" is only updated for people who already have an entry, but not INSERTED into the table if there is no entry for that persons UID. I need the script below to check to see if the UID exists in the table and if not to INSERT them as logged in as well as update it when a new user logs in the first time. I know its just a simple bit of code, but for some reason i cant get it to work.
Text Formatted Code
function plugin_user_login_staticpages($uid) {
global $_CONF,$_TABLES;
if (DB_getItem($_TABLES['custom_member'],'has_logged_in',"member_uid=$uid") == 0) {
DB_query("UPDATE {$_TABLES['custom_member']} set has_logged_in=1 WHERE member_uid=$uid");
echo COM_refresh($_CONF['site_url'] . '/staticpages/index.php?page=newuser');
exit;
}
}