INSERT INTO fields (id_region, id_fields_info, subsidy_dka, id_rents_dka, type_uses, id_rented_from, id_categories, id_farmer, id_season)
SELECT
regions.id,
fields_info.id ,
120,
rents_dka.rent_dka,
"собствена",
rented_froms.id,
categories.id_category,
farmers.id,
seasons.id
FROM regions, fields_info, rents_dka, rented_froms, categories, farmers,
seasons
WHERE
region = "Азмък" AND
field_num = 2222 AND
rent_dka = 60 AND
name = "Десислав" AND
id_category = 3 AND
name = "Десислав" AND
season = "2012-2013"
所以我有这些表:
regions,
fields_info,
rents_dka,
rented_froms,
categories,
farmers,
seasons
他们充满了一些数据。
我已经制作了一个表单,用户使用这些表中的数据填充字段,我已经提到过,当单击提交按钮时,我想用从数据中获得的 ID 填充 MYSQL 中的表 FIELDS,用户已经进入。