Hi there,
I have an INSERT query that fires based on whether or not a user is logged in. The first query in the script works propery and adds the user to the table 'users' each time I log in with a new user. The second table 'profiles' only allows 1 entry, so if I drop all the records in the table, and log in with 'userXYZ' it will make that entry into the table. If I log in with another user 'userABC' it won't make the entry. This works the first time no matter who I log in with. The first table 'users' allows me to continue adding users (making a new record each time a new user logs in). I'm probably missing something simple, but I would greatly appreciate some assistance.
Best regards,
Harold
***You can't change your past, but you can change your future***
I have an INSERT query that fires based on whether or not a user is logged in. The first query in the script works propery and adds the user to the table 'users' each time I log in with a new user. The second table 'profiles' only allows 1 entry, so if I drop all the records in the table, and log in with 'userXYZ' it will make that entry into the table. If I log in with another user 'userABC' it won't make the entry. This works the first time no matter who I log in with. The first table 'users' allows me to continue adding users (making a new record each time a new user logs in). I'm probably missing something simple, but I would greatly appreciate some assistance.
Code:
include ('config.php');
include ('opendb.php');
if ($un == "Anonymous") {
} else {
mysql_query("INSERT INTO users (username,state,jobtitle,uscitizen,yearsofexperience)
VALUES ('$un','not specified','not specified','not specified','not specified')");
mysql_query("INSERT INTO profiles (username,nickname,height,weight,hair,eyes,location,age,hobbies,relationshipstatus,favoritemusic,education,work,favoritefood,dislikedfood,favoritetvshows,dislikedtvshows,favoritemovies,dislikedmovies,favoritevideogames,stuffyoudislike,favoritewebsites,favoriteseasons,backgroundcolor,sidebarcolor,backgroundtiled,backgroundpicture)
VALUES ('$un','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified','Not Specified')");
}
Best regards,
Harold
***You can't change your past, but you can change your future***