Jump to content

Not Showing Up


Faracus
 Share

Recommended Posts

I am having a small issue. when using the code below it is not creating the username in the MySQL database, but the password part is going in.

$sql="INSERT INTO admins (Username, Password)VALUES('$_POST[username]','$_POST[password]')";if (!mysql_query($sql,$con))  {  die('Error: ' . mysql_error());  }echo "Your account has been created.";

Link to comment
Share on other sites

Did you print out $_POST['username'] to see what's actually there, or did you print the SQL query? If the password is being inserted then the query is working. If there's no value for the username, then $_POST['username'] is empty. Check your field names in the form.

Link to comment
Share on other sites

  • 2 weeks later...
Did you print out $_POST['username'] to see what's actually there, or did you print the SQL query? If the password is being inserted then the query is working. If there's no value for the username, then $_POST['username'] is empty. Check your field names in the form.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...