Incorrect table name, php/mysql -


itemprop = "text">

I have found this code

  mysqli_query ($ userdatabase, 'create table' _user '. $ Emailreg.' (id not integer NULL AUTO_INCREMENT primary key, IP varchar (10), FLD1 varchar (20), FLD2 varchar (40), FLD3 varchar (25), FLD4 varchar (25), FLD5 varchar (25 )) '); Echo (mysqli_error ($ userdatabase));  

That works fine on my local host, but when I upload it to the server, it seems to me giving me a "wrong table name 'user_vasya@rossya.pu'" is. Any ideas?

Thank you! After the text "itemprop =" text ">

After you say that" I create a table per user "This is an antipatine which I < Strong> Metadata Tribes . The problem is that these tables reproduce out of control. : -)

Instead, you should prepare a table for the user's email as a feature.

If you use the SQL table name special characters, or even empty space, include SQL reserved words, international characters, etc. But if you use the back quote Turn off, @ and take it. is not valid for the character as an identifier, because it confuses the SQL parser: Think about it: Do you use any other programming languages ​​that have a . Accept a variable named as a valid character in the name or class name?

Other tips:

IP is more easily stored as INT unassigned , and there are functions And convert binary equivalents to and from IP address string. This helps you to ensure that you do not accidentally store an invalid IP address. In addition, you can use bitwise binary operators operating subnet masking against an IP address in binary form.

Column FLD1 , FLD2 , FLD3 are not descriptive and indicate that you have sufficiently Not designed You may also need to manage multi-valuable features, but no one can tell how to do this because your column name is exactly the same.


Comments