Jump to content

Not Showing Up


Faracus

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...