You are here:

MySQL/database design and coding for Front-End Web Developer

Advertisement


Question
Hello,

The code value is basically a unique 'product' value (like a bar code). Each user must have a code value so they than track their product(s).

That being said, the code value is not used for user login. However it would be required at least 1 when the user signs up for the first time.

Hope this helps.

Thanks you

----------------------------------

Hi

i understand it can be any value but what is the point of the code value. Does this have any dependency on the user login or not. In order for the script i would need to know if and how the code value intends to be used.

I write a large number of secure login sctipts each month and i would write this one using php. Php sessions and mysql database using md5 sum for the password.

Answer
Hi

Sorry for the delay in replying I have been in meetings.

below is the mysql code for the database side. Do you need help with the following.

Connecting to the database
creating user registration
creating user login
creating the user authentication script to protect pages (stops no logged in members access pages)


CREATE TABLE IF NOT EXISTS `members` (
 `user_id` int(11) NOT NULL AUTO_INCREMENT,
 `user` varchar(100) NOT NULL,
 `passwd` varchar(300) NOT NULL,
 `email` varchar(300) NOT NULL,
 `code` varchar(20) NOT NULL,
 `name` varchar(150) NOT NULL,
 PRIMARY KEY (`user_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;


passwords should always be encrypted with md5 when the are entered to the database  

MySQL

All Answers


Answers by Expert:


Ask Experts

Volunteer


stuart gregory

Expertise

PHP html, xhtml, css coding and MySQL

Experience

My experiance is all first had as I am web developer and I have, and do build many websites all using php and mysql. This ranges from building a simple search engine to secure php login scripts. Some websites like http://www.web-application-development.info are complete database driven websites.

Organizations
I have a large number of websites which I host and maintain, such as. http://www.webreger.com http://www.universalscience.co.uk http://www.modellingelectronics.co.uk

Education/Credentials
Web application development. (Open University) BSC Honers Computing and development (Open University)

©2016 About.com. All rights reserved.