English 中文(简体)
I m试图为每个登记用户建立一个数据库表。 我做了什么错误?
原标题:I m trying to create a database table for each user who registers. What am I doing wrong?

I am trying to work on a login and registration page and I am making a new database and i can do it fine like this:

mysql_select_db("my_db", $con);

$sql = "CREATE TABLE Persons
(
  FirstName varchar(15),
  LastName varchar(15),
  Age int
)";

// Execute query
mysql_query($sql,$con);

我试图做的是将“人”改为“人”,以便它能够提出一个表,但它是动态的。 我需要说明一下,因为我正在为每个用户提供一个表格,登记和新的表格名称是用户名称和密码通过5 mdsum加密发送。 我试图这样做,但没有取得任何成功,就象另一个人一样,得出一个新桌:

mysql_select_db("my_db", $con);

$sql = "CREATE TABLE $data
(
  FirstName varchar(15),
  LastName varchar(15),
  Age int
)";

// Execute query
mysql_query($sql,$con);

请帮助我。 我曾试图与我需要帮助的无望者一道进行扼杀。

最佳回答

I m试图为每个登记用户建立一个数据库表。 <>strong>?

你们正在为每个登记用户建立一个数据库表。

这并不是你改用关系数据库的方式。 你们为每个新用户设立一个row>/em>,而不是一个表格。 当然,你在<密码>的表格中需要一栏,如。 密码。 我也建议不要因为年龄不固定而使年龄永久化。 印有<条码>。

INSERT INTO Persons (FirstName, LastName, Birthday, Password)
VALUES ( John ,  Smith ,  1980-07-21 ,  SOME HASH HERE );

我希望你不会错过,但是,在试图起草更多的法典之前,你需要放慢,更多地了解情况。 我相信,从长远来看,情况会更好。

问题回答

I m looking back at some of the questions I ve asked in the past in it s crazy to see how much I ve learned in the past few years.





相关问题
Simple JAVA: Password Verifier problem

I have a simple problem that says: A password for xyz corporation is supposed to be 6 characters long and made up of a combination of letters and digits. Write a program fragment to read in a string ...

Case insensitive comparison of strings in shell script

The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

String initialization with pair of iterators

I m trying to initialize string with iterators and something like this works: ifstream fin("tmp.txt"); istream_iterator<char> in_i(fin), eos; //here eos is 1 over the end string s(in_i, ...

break a string in parts

I have a string "pc1|pc2|pc3|" I want to get each word on different line like: pc1 pc2 pc3 I need to do this in C#... any suggestions??

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...