Jump to content


Photo

Creating New USers in a Database


  • Please log in to reply
4 replies to this topic

#1 Esia0

Esia0
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 May 2003 - 09:53 AM

Ok i Created a database . .
then how am i going to add a username to it ?

and also the password

do i need to create a table for it? ? ?


pls advise ..

thanks alot !

#2 Avalanche

Avalanche
  • Members
  • PipPipPip
  • Advanced Member
  • 73 posts

Posted 18 May 2003 - 06:59 PM

Yes, you will need to create a table with at least two fields.

I would make one named \"username\" and one named \"password\". Try setting both to a varchar of 50.

Also, you may want to encrypt the password before you insert it into your table.
DEFINE("YOU","Spending Too Much Time On The Computer");

#3 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 19 May 2003 - 11:26 AM

Esia if u are looking to restrict the database based on the user

then u have to set the permission level in the user table

select * from `mysql`.`user

Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#4 jpjsmith

jpjsmith
  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationUSA

Posted 20 May 2003 - 09:28 AM

i understand the coulumn type for a password should be varchar and encryption is a good idea- the questoin is, how do you encrypt the password?

#5 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 20 May 2003 - 09:50 AM

Use md5() function in PHP

U cant dencrypt a md5

all u can do is compare 2 md5 strings!!

like get the password from user convert that to md5 using PHP

md5() and then compare it !!

Hope this helps!
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users