我有一个便利设施表,其中为每个属性逐一插入数据,现在我想创建属性的重复项,但它给出了错误。
$sql = "insert into property ($column_str) select $column_str from property where pid = $duplicate_id";
它适用于单行,但当我插入属性 ID 时,它不起作用。我的另一个查询是
$sql = "insert into apartment_amenity (`property_id`,`amenity_id`) SELECT `1495`,`amenity_id` FROM apartment_amenity WHERE `property_id` = 1494"
最佳答案
使用单引号'
来包裹1495而不是刻度线`
关于php - 在同一个表mysql中插入多个重复行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32200984/