A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Simple PhpMyAdmin MySQL Question

  1. #1
    Juvenile Delinquent CVO Chris's Avatar
    Join Date
    Jul 2002
    Location
    Ulster, UK
    Posts
    520

    Simple PhpMyAdmin MySQL Question

    I am creating a database called "accounts" with the table "users". It will contain the fields "id"<=(primary), "username", "password", "email" and "credits".

    Users to my website will log in through a form that will ask them for username and password. They will add all information in by themselves except for the "id" field and "credit" field.

    2 questions:

    Should I put the "id" field on 'auto increment' in the "Extra" option as it is the primary?

    Credits will have a monetary value. Should I put this on a separate DB for security reasons? ie: will it be easier to hack because it is in the same DB as the fields that users will be able to add to (username, password + email).

    Edit:

    Another question. I have a dynamic textfield at the bottom of my movie which will display the username of the person who has logged in. Once the next scene loads the movieclip which contains the username textfield will be loaded again. Do I need to load the username again or will the variable remain even though a new scene is loaded?

    Silly questions but I'm new to this database stuff! Once again thanks!
    Last edited by CVO Chris; 01-18-2008 at 12:02 PM.

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    I think it's mostly opinionated but I ALWAYS make an id field that is auto-incremented and primary. I think it is only good practice and makes for much more fail safe relationship queries down the road.

  3. #3
    Agreed about the auto increment. I also use to ensure a unique value in each table.

    Using a second database will only obscure your code, not secure it. If the first database is hacked into, there's no reason that the second one will be hacked into as well.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center