Filling A New Users Account With Some Data

Discussion in 'Databases' started by timallard, Apr 24, 2009.

  1. #1
    Hello,

    I want to fill a new users account with some data. Basically, when an admin creates a new user account, I want that new users account to have a "list" all ready set up and ready to go.

    e.g.

    New user account gets created, when they login for the first time, they see something that says "My First List".

    Im in the code and am not sure how to insert to an ID that is not created yet...how would i go about doing this? here is my code..

    This is the process page. Previous page is the form page.

    $listName = "My First List";
    $listType = "Private";
    listState = "Active";

    $today= date("m/d/y",time());

    $generateList= mysql_query("INSERT INTO lists SET listName='$listName', listType='$listType', listState='Active', userid='?????', dateCreated='$today'")
    or die(mysql_error());

    So basicly i need to figure out how to insert it into a userid's profile whose id isnt generated yet..

    Thanks!
     
    timallard, Apr 24, 2009 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    hmmmm I hope I got what u need
    what about doing 2 separate tables? and get the details from there for each user which will be generated?
     
    crivion, Apr 24, 2009 IP
  3. timallard

    timallard Well-Known Member

    Messages:
    1,634
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    158
    #3
    mmm im not 100% sure i follow, sorry, im kinda new at this.

    I guess my scenario would be like... creating a new myspace account and finding a message from Tom there when logging in for the first time.

    How do you knwo what id to insert into if the id# hasnt been generated yet?
     
    timallard, Apr 24, 2009 IP