【发布时间】:2015-03-03 02:58:30
【问题描述】:
我有 2 个表,我无法将这些表的值合并到 table2 中。
Table1:
id | studnum | fname | lname | mname
1 | 1001 | Mark | Lei | Ramos
Table2:
id | studnum | remarks
是否有可能当我将值输入到 Table2 时,Table1 中的 studnum 也会输入到 Table2 中?
我试过了,但是没有用。
$sql = "SELECT table1.studnum FROM table1, table2
WHERE table1.studnum = table2.studnum";
这样Table2就会像这样输出
id | studnum | remarks
1 | 1001 | good
【问题讨论】:
标签: php html mysql select join