1
我將如何做到這一點(方括號中的部分):簡單的MySQL查詢問題
$name = 'Bob';
mysql_query("INSERT INTO table(field1,field2)
[ select value of field1 from another table ], '$name'");
我將如何做到這一點(方括號中的部分):簡單的MySQL查詢問題
$name = 'Bob';
mysql_query("INSERT INTO table(field1,field2)
[ select value of field1 from another table ], '$name'");
它的SQL部分可能是這樣的:
INSERT INTO table1 (field1, field2) SELECT field1, 'Bob' FROM table2 WHERE ...
動態構建在PHP是一個簡單的練習,我留給讀者:)