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 7664773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:23:22+00:00 2026-05-31T14:23:22+00:00

I have built a simple registration form shown below and Iam trying to get

  • 0

I have built a simple registration form shown below and Iam trying to get the users to have their passwords encrypted and then entered into my database. I am attempting to use md5 encryption. I have also attached the database connection script.

My goal is when I check my database, I want to see the following: ( id, name, username, encrypted password )

The issue I have is that the form does not process completely. All I get this error (Error: Unknown column ‘d8578edf8458ce06fbc5bb76a58c5ca4’ in ‘field list’ ).

Could some tell me or show me ” What is it that needs to be corrected either in my Code or SQL insert and /or my Variables” to make this work correctly. I know that its probably a very, very simple fix. I am just stuck at this point.

I really appreciate your help.

<?php
error_reporting(0);
if($_POST['submit'])
{ //Begining of full IF Statment
$name = $_POST['name'];
$username = $_POST['username'];
$password = $_POST['password'];
$confirm_password = $_POST['confirm_password'];
// Encrypt Pasword
$enc_password = md5($password);
//$enc_password2 = md5($confirm_password);


// Confirm All feild were filled out when submit button was pressed
if($name && $username && $password && $confirm_password) 
{
// Confirm that the NAME that you used is NOT greater than 30 characters     
     if(strlen($name)>24)
     {
     echo "<h2><center>YOUR NAME IS TOO LONG!!!!</center></h2><br>";
     }
// Confirm that the USERNAME that you used is NOT greater than 10 characters        
    if(strlen($username)>10)
     {
     echo "<h2><center>YOUR USERNAME IS TOO LONG!!!!</center></h2><br>";
     }
     else {

// Confirm that the PASSWORD that you used MATCH & Between 6 and 15 characters   
        if(strlen($password)>10 || strlen($password)<6)
         {
         echo "<h2><center>YOUR PASSWORD MUST BE BETWEEN 6 and 15          CHARACTERS!!!!</center></h2><br>";
         }
        if($password == $confirm_password)
        {
        // Database Connection required
        require "db_conncect.php";
        // We Now connect to the Dabase and insert the Form input details
        //------- ### ENTERING ALL INFORMATION INTO THE DATABASE BELOW ### --------// 


// 1. Create a database connection
$con = mysql_connect("localhost","root",""); // <-- THIS IS WHERE YOU " CAN CHANGE " THE USERNAME IS "root", PASSWORD IS "" ONLY.

if (!$con) {
  die('Database connection failed could not connect: ' . mysql_error());
  }

// 2. Select a database to use
$db_select = mysql_select_db("registernow_2012",$con); // <-- THE "registernow_2012" IS     THE NAME OF THE DATABASE.
if (!$db_select) {
  die('Database selection failed could not connect: ' . mysql_error());
}

mysql_select_db("registernow_2012", $con); // <-- THE "registernow_2012" IS THE NAME OF THE DATABASE TO BE CONNECTED.

    // <-- THE `registernow_2012` IS THE NAME OF THE DATABASE TO BE CONNECTED....     `visitors` IS THE TABLE WITH ALL THE FIELDS WITHI IN THE DATABASE.


$sql="INSERT INTO `registernow_2012`.`users` (`id` , `name` , `username` ,
`$enc_password` , `confirm_password`    )
VALUES (NULL , '$_POST[name]', '$_POST[username]', '[$enc_password]', '$_POST[confirm_password]')";


if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
}

// 3. Close Connection
mysql_close($con);

header("Location: index.php");  // <-- THIS IS WHERE YOU CAN CHANGE THE "Location: Thank you / Index page" of the THANK YOU PAGE.       

        }
    else 
    {
    echo "<h2><center>PASSWORDS MUST MATCH!!!!!</center></h2><br>";
    }   

     }

    //echo "<h2><center>WORKING!!!!</center></h2>";
}   
else echo "<h2><center>ALL FEILDS MUST BE COMPLETED</center></h2>";

} //Ending of full IF Statment
?>

<!DOCTYPE html>
<html lang='en'>
    <head>
        <title>THE FORM MY WAY NOW</title>
    </head>
<body>
<div id='centerstage'>
    <form name="myform" action="workingitoutproperly.php" method="POST">
      <p>
        <label>Name</label><br>
        <input type='text' name='name' value=''><br>
        <label>UserName</label><br>
        <input type='text' name='username' value=''><br>
        <label>Password</label><br>
        <input type='password' name='password' value=''><br>
        <label>Re-Enter Password</label><br>
        <input type='password' name='confirm_password' value=''><br>
        <br>
        <input type='submit' name='submit' value='REGISTER NOW!!'>
    </p>
</form>
</div>
</body>

  • 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-05-31T14:23:23+00:00Added an answer on May 31, 2026 at 2:23 pm

    This line is the source of your problems.

     $sql="INSERT INTO `registernow_2012`.`users` (`id` , `name` , `username` , `$enc_password` , `confirm_password`    ) VALUES (NULL , '$_POST[name]', '$_POST[username]', '[$enc_password]', '$_POST[confirm_password]')";
    

    Let’s break it down:

    First, we need to remove a stray $ from the field name:

    INSERT INTO `registernow_2012`.`users` (`id` , `name` , `username` , `$enc_password` , `confirm_password`
    //                                                                   ^^^ Remove me!
    

    Next, we need to escape our input (unless you want a visit from Bobby Tables):

    NULL , '".mysql_real_escape_string($_POST['name'])."', '".mysql_real_escape_string($_POST['username'])."', '$enc_password', '".mysql_real_escape_string($_POST['confirm_password'])."')
    

    So the final line will look like this:

    $sql = "
      INSERT INTO `registernow_2012`.`users`
        (`id` , `name` , `username` , `enc_password` , `confirm_password`)
      VALUES
        (NULL , '".mysql_real_escape_string($_POST['name'])."', '".mysql_real_escape_string($_POST['username'])."', '$enc_password', '".mysql_real_escape_string($_POST['confirm_password'])."')
    ";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a simple site that allows users to share code where the
I'm trying to build a simple controller for a registration form as seen on
I have built a simple game in WP7 and I am trying to add
I have built a simple C#.Net app on a M/C with only .Net FX
I have built a simple Eclipse plugin where a user may use a TableViewer
I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of
I have built a pretty simple REST service in Sinatra, on Rack. It's backed
I have built a very simple blog application using Ruby on Rails. New to
Does Python have a built-in, simple way of encoding/decoding strings using a password? Something
I have a simple web app built in asp.net webforms c# where and how

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.