php - insert multiple duplicate rows in a same table mysql -


i have table of amenities in data inserted 1 one each property , want create duplicate of property gives error.

$sql = "insert property ($column_str) select $column_str property pid = $duplicate_id"; 

it works single row when insert property id doesn't work. other query

$sql = "insert apartment_amenity (`property_id`,`amenity_id`) select `1495`,`amenity_id` apartment_amenity `property_id` = 1494" 

use single quotes ' wrap 1495 instead of tick marks `


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -