gpt4 book ai didi

Symfony2 (doctrine) 原生 sql 插入

转载 作者:行者123 更新时间:2023-12-01 10:59:25 25 4
gpt4 key购买 nike

如何在本地 sql 上的 symfony2 Doctrine 2 中插入数据?

我的查询

insert into propriedades (id,name,descripcion,num_lote,cod_imovel,imovel,convenio,proprietar,cpf,area_ha,perimetro,location,centro) VALUES (nextval('propriedades_id_seq'),'?','?','?','?','?','?','?','?','?','?',ST_GeomFromKML('<Polygon><outerBoundaryIs><LinearRing><coordinates>".$terra['coordinates']."</coordinates></LinearRing></outerBoundaryIs></Polygon>'),ST_Centroid(ST_GeomFromKML('<Polygon><outerBoundaryIs><LinearRing><coordinates>".$terra['coordinates']."</coordinates></LinearRing></outerBoundaryIs></Polygon>')))

最佳答案

您必须使用 $conn->insert('table', $dataArray); .见 documentation

关于Symfony2 (doctrine) 原生 sql 插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12538807/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com