SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast imati0n's Avatar
    Join Date
    Feb 2003
    Location
    Savannah, GA
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick sql question

    PHP Code:
     $sql 'INSERT INTO `members` ( `id` , `PASSWORD` , `username` ) VALUES ( '?', '$password', '$username' ); '
    Where the ? is, I want to make it so whenever a user registers, it runs this code and the id goes up automatically (AUTOINCRIMENT or something to that effect)

    Could someone show me how this is possible?

  2. #2
    SitePoint Addict Huscy's Avatar
    Join Date
    Jul 2002
    Location
    Newcastle, UK
    Posts
    318
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $sql = 'INSERT INTO `members` ( `id` , `PASSWORD` , `username` ) VALUES ( '', '$password', '$username' ); ';

  3. #3
    SitePoint Addict Huscy's Avatar
    Join Date
    Jul 2002
    Location
    Newcastle, UK
    Posts
    318
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    presuming you have the id field set to auto inc?

  4. #4
    SitePoint Enthusiast imati0n's Avatar
    Join Date
    Feb 2003
    Location
    Savannah, GA
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot =D


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •