Quote:
|
Something else... Mysql database gives me a limit of 255 IDs. Is there a way to increase this number or I must creating a new db every time after the 255 ID?
|
You need to set the data type of your ID field to "int" for up to 99999999999 unique ID's, or even "bigint" for even more. Then set the "extra" parameter to auto_increment if it isn't already. That will solve your problem with the limit of 255 on the ID's.
Once you have made those changes to your DB, you can leave the ID field out of your INSERT query, as MySQL will handle it automatically. For example, your new query would be:
Code:
$query="INSERT INTO Register (Full_Name, Birthday, Phone_No, E_mail, Mail, Username, Password) VALUES ('$Full_Name','$Birthday','$Phone_No','$E_m ail','$Mail_Adrdress','$Username','$Password')";
As for your code problem, are you giving us all your code? if so, the reason all the fields but the ID are empty in the DB is that you haven't POST'ed the values to your script and haven't got code to set the variables prior to the INSERT query (unless that is done in register.html, which should be named register.php if it has PHP in it...). Thus, all you add to the DB is empty values. As a result, when the code runs the second time, there is already a user in there with an empty user name and you get a "Username already registered" message.
By the way, make sure you incorporate some code to validate the POST variables or you are leaving your site wide open for a SQL injection attack. You might also add some code to handle magic quotes, which are usually enabled.
You can Google for sample of PHP from handling that will give you some good examples of how to handle what you are attempting, just make sure the ones you use include the validation and security measures I mentioned above.