Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8154219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:16:04+00:00 2026-06-06T16:16:04+00:00

I need some direction please. From my reading up on MYSQL I learned that

  • 0

I need some direction please. From my reading up on MYSQL I learned that to properly config my DB and keep it running optimally I need to make my DB as follows. Say for example I have

DB Members: which holds~ 1-Primary_ID, 2-email, 3-password, 4-address_ID, and 5-phone_ID. 

Ok so now I know I need to make a new DB named DB: address and another DB: phone

DB Address: which holds~ 1-address_ID(UNIQUE), 2-street, 3-city, 4-state, 5-zip

finally another DB: phone

DB Phone: which holds~ 1-phone_ID(UNIQUE), 2-area code, 3-phone

Question #1: is this an efficient way to setup my database? && Is it correct?

Question #2: When using PHP to INSERT the record from an HTML form. How do i ensure that the address inputted in the form is assigned to DB address and the correct address_ID is recorded in DB Members? && same for phone_ID in DB Phone AND DB members?

Thanks for the help!

What should my mysql_query statement look like?

mysql_query("INSERT INTO Members (email, password, address, phone, timeStamp) 
VALUES('$email', 'SHA($pass)', '$address', '$phone', now())");

How do I assign address to the address DB and phone to phone DB? Do i need to use separate insert statements? and if so- how do I get their proper ID’s into DB members?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:16:06+00:00Added an answer on June 6, 2026 at 4:16 pm

    Do not use SHA() to hash your passwords

    From the MySQL reference manual:

    Exploits for the MD5 and SHA-1 algorithms have become known. You may
    wish to consider using one of the other encryption functions described
    in this section instead, such as SHA2().

    The mysql_* suite of functions should not continue to be used

    “This extension is not recommended for writing new code. Instead,
    either the mysqli or PDO_MySQL extension should be used.” –PHP.net

    Now, regarding your questions

    is this an efficient way to setup my database? && Is it correct?

    It depends. Do you intend to only have one phone number per user, and one address per user? By specifying an address_ID field on the members table, you effectively limit the amount of addresses that member can be limited to to one. Alternatively, if you want to allow a user to have any number of addresses or phone numbers, the phone and address tables should have references to the member–not the other way around.

    If you really do only want one address and phone number per member, you should include all of that information on the members table. This will prevent unnecessary joins, and you can always specify what you want to SELECT.

    If you want multiple addresses and phone numbers, you still might want to denormalize and just use a single table for all of that data. You would just have to limit the user to some reasonable number of addresses or phone numbers.

    How do i ensure that the address inputted in the form is assigned to
    DB address and the correct address_ID is recorded in DB Members? &&
    same for phone_ID in DB Phone AND DB members?

    If you use mysqli, use the insert_id property. If you use PDO, use the lastInsertId() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some css files that i need to use in RTL direction template.
I need to extract some data from a webpage with php. The part that
Wondering if I could get some advice and direction on this following requirement: Need
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for
i need some clarification please: the process is essentially as follow: client fills out
I've got a table from an existing LabView VI (ewww!) that I need to
Need some regular expressions help. So far I have my code working to allow
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need some quick advice I am trying to access a object array but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.