0

I'm almost done making my registration system on my home server.

Thanks to everyone for your help.

The last thing I would like to know is why it says: Error: User not added to database.

This is part of my register code:

// Fields are clear, add user to database
    // Setup query
    $q = "INSERT INTO `dbusers` (`username`,`password`,`email`) "
    ."VALUES ('".$_POST["username"]."', "
    ."PASSWORD('".$_POST["password"]."'), "
    ."'".$_POST["email"]."')";

My database is made and named like in dbconfig.php

$db = "mysqladmin";

My table is dbusers but the columns/rows are made manually...

What could be the problem?

2
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by fifarulez
1

Hii,may be the username field is unique and you entered duplicate name in the same field... question: where the primary key of dbusers table you made?
%^^%Murtada%^^%

0

Oh I see, and I don't really understand the question but..
This is the query I'm trying to execute on SQL

CREATE TABLE dbUsers(
id int(10) Primary Key, AUTO_INCREMENT
username varchar(16) Unique
password char(16)
email varchar(25)

but it doesn't work....

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'username varchar(16) Unique
password char(16)
email varchar(25)' at line 3"

Edited by fifarulez: missing info

0

try this:

CREATE TABLE dbUsers(id int(10) Primary Key AUTO_INCREMENT,username varchar(16) Unique,password char(16),email varchar(25);
0

Everything seems to work when I don't input a password...
it's

password char(16)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.