Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My datatabase name is dbtest and the table is name is users. For some reason the code isn't working correctly. The information is not being

My datatabase name is dbtest and the table is name is users. For some reason the code isn't working correctly. The information is not being stored in the database and it is not showing any errors when password and confirm password are different and when the chracter length exceeds 25 characters. I have no idea what I am doing wrong. Thank you for your help.

$connect = msql_connect("localhost", "root", ""); mysql_select_db("dbtest"); $namecheck = mysql_query("SELECT username FROM users WHERE username='$username'"); $count = mysql_num_rows($namecheck); if($count!=0) { die ("Username already taken!"); } // all feilds filled if ($username&&$email&&$firstname&&$lastname&&$password&&$confirmpassword) { // making sure that password and confirm password are the same if ($password == $confirmpassword) { if(strlen($username) > 25 || strlen($firstname) >25 || strlen($lastname) > 25) { echo "Length of username, first name, or last name is too long"; } else { if (strlen($password) > 25 || strlen($password) < 6) { echo "Password should be between 6 and 25 characters"; } else { // registering the user $queryreg = mysql_query("INSERT INTO users VALUES (' ', '$username', '$lastname', '$firstname', '$password')"); die("You have been registered! Return to sign in page"); } } } else echo "Yor passwords do not match!"; } else echo"Please fill in all fields!"; } } ?>

SignUp Page

First Name:

Last Name:

Username:

Email:

Password:

Confirm Password:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago