| | |
Dot in the username is creating problems.
Thread Solved |
•
•
Join Date: May 2008
Posts: 69
Reputation:
Solved Threads: 4
Hello all,
I have this strange problem.
During registration if user chooses to have '.' in his username, eg: sam.leo then i am getting this wierd problem .
-respective tables with the given username are not getting created in the Database.
Everything is working fine if usernames are having no special characters.
Other than asking users not to use any special characters, how can I solve this!!
Can someone tell me why is this happening and how to get rid off this
Thankyou all in advance.
I have this strange problem.
During registration if user chooses to have '.' in his username, eg: sam.leo then i am getting this wierd problem .
-respective tables with the given username are not getting created in the Database.
Everything is working fine if usernames are having no special characters.
Other than asking users not to use any special characters, how can I solve this!!
Can someone tell me why is this happening and how to get rid off this

Thankyou all in advance.
Last edited by Kavitha Butchi; Sep 7th, 2008 at 9:46 pm.
We would need to see your code / mysql queries where the rows are being added to the table.
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
•
•
Join Date: May 2008
Posts: 69
Reputation:
Solved Threads: 4
Thankyou for the quick reply.
Here is the related code.
-> Tables in a database are not getting created when a dot is used in username.
-> But records are getting created in a table(already created tables which are same for all users)
Everything is working fine when dot is not used.
using=> Godaddy hosting connection, mysql databases.
Please let me know if i need to post anyother details.
Here is the related code.
php Syntax (Toggle Plain Text)
//Code for creating a table --[not wokring when dot is used in username] mysql_connect(" ---") ; mysql_select_db("---"); mysql_query("CREATE TABLE $username( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), order VARCHAR(990), date datetime NOT NULL default '0000-00-00 00:00:00')"); mysql_connect("---") ; mysql_select_db("---"); //creating table another table[-not working when dot is used in username--] mysql_connect("------") ; mysql_select_db("-----"); mysql_query("CREATE TABLE $displayname( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), likeditem VARCHAR(30))") ;
-> Tables in a database are not getting created when a dot is used in username.
-> But records are getting created in a table(already created tables which are same for all users)
Everything is working fine when dot is not used.
using=> Godaddy hosting connection, mysql databases.
Please let me know if i need to post anyother details.
Last edited by Kavitha Butchi; Sep 7th, 2008 at 10:28 pm.
•
•
Join Date: May 2008
Posts: 69
Reputation:
Solved Threads: 4
•
•
•
•
I agree with keith. What happens when you have 100 users? You are going to have 100 user tables with one row of data in each. Bad design. All of this could be done with 1-3 properly normalized tables.
The individual tables created in my database are used to keep track of all the chat conversations of the user.
I considered that option long before while creating tables with the usernames but was taken back with the idea that it may be well organised rather than creating feilds or records in a single table.
But now seems like there is no other option left and hence shall think abt modifying the structure.
Can someone tell me is there any other solution for this problem?!
Also,
Which one is better?I mean which one is of low burden to the database.
-100 feilds in a table.
-100 records in a table.
-100 tables in a database.
Thankyou all in advance.
Last edited by Kavitha Butchi; Sep 8th, 2008 at 10:25 am.
Having a dot in the username will not work because most SQL languages use the dot as a relation. So an username like "Jesus.Christ" will try to create a table called 'Christ" in the schema "Jesus". As there is a very low probability of the schema being actually "Jesus", the table creation will fail.
To check, try using your schema.something as username. For example, if your schema is called "MySchema", create an user as "MySchema.NewUser". This should work and create a table called "NewUser" (NOT MySchema.NewUser) in the schema "MySchema".
As for the rest of your question, having a table for each user is not really a good idea. Having a table with 100 fields is even worse. If you need to look up a non-indexed field, the DB Engine will have to read through all 100 fields.
Best solution = 100 records in 1 table, properly indexed. As far as practicable, try normalising the tables so that data-scans are faster.
To check, try using your schema.something as username. For example, if your schema is called "MySchema", create an user as "MySchema.NewUser". This should work and create a table called "NewUser" (NOT MySchema.NewUser) in the schema "MySchema".
As for the rest of your question, having a table for each user is not really a good idea. Having a table with 100 fields is even worse. If you need to look up a non-indexed field, the DB Engine will have to read through all 100 fields.
Best solution = 100 records in 1 table, properly indexed. As far as practicable, try normalising the tables so that data-scans are faster.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Trying to display an image rom mysql: whats wrong
- Next Thread: POST data issue when return to page
Views: 752 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for PHP
access ajax apache api archive array arrays auto beginner binary box buttons cakephp check checkbox class cms code database date development directory display download dropdown dynamic echo email error file files form forms function functions header href htaccess html image images include insert ip java javascript joomla jquery limit link list login loop mail mlm mod_rewrite multiple mysql order parse paypal pdf php problem query radio redirect regex remote rewrite script search select server session shopping soap sort source sql storage string structure syntax system table tutorial update upload url user validate validation validator variable video web website wordpress xml






