Jump to content

Please Help!! Login in database with client provided usernames and passwords


Recommended Posts

My client wants a splash page for his initial index page and doesn't not want people to be able to go any further into the website with a username and password he will provide for them directly. On that splash page he wants a place for them to login with the username and password he provided. How to I create a database for this? I am total lost! Please help me. I am brand new to this stuff.

Thanks so much to anyone who will help me!

Link to comment
Share on other sites

Designing databases is a job by itself!


Minimum requirement would be a one table with three columns: client_id, username and password.


create table client(

  client_id  int(10),

  username  tinytext not null,

  userpass  varchar(50)



When inserting you could use the syntax:



VALUES (<client number>, '<username>', PASSWORD('<password>');



When confirming the user you could use the syntax:


SELECT username

  FROM client

WHERE client_id = <input id value>

    AND userpass = password(<'password supplied'>);


With what little information you have supplied, there is no way to really help you out.


These are just suggestions.  If you need a database designed and constructed you may consider a third party vendor.  A badly built database will kill you in the long run.


I know, I built Oracle and MySQL database for a living.

Link to comment
Share on other sites

CanMike: The following is straight out of the mysql documention with added underline.


Note: The PASSWORD() function is used by the authentication system in MySQL Server; you should not use it in your own applications. For that purpose, use MD5() or SHA1() instead. Also see RFC 2195 for more information about handling passwords and authentication securely in your applications.

Link to comment
Share on other sites

The password() function is the minimum requirement to encrypt data.  You can use MD5() of SHA1(), depending upon the depth of encryption you require.


This is why designing and building a database can be a lot more complicated than you think. 


As I stated in my response, this is just a suggestion has to how you could add a table to a database, populate the fields and then access the data.  You'll have to talk to your client to get a clear understanding as to how 'encrypted' the data must be.


I use the password() function on all my applications without any problems to date.  I've used SHA1 on v4 MySQL and had a problem with the function when I upgraded to v5 MySQL.  It was a problem with the initial length of the field in the column definition.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.