0
I have 02 tables in the bank (Prospect and opportunity) the two tables have the prospectId. As I do to display in ng-repeat. I was trying to Inner Join in the php query and returns this error in the angular "Error: [ngRepeat:dupes]". Do you have an example.
/* Lista oportunidade */
$scope.listaOportunidades = [];
var carregaOportunidades = function () {
$http.get("models/readOportunidades.php")
.then(function (response) {
$scope.listaOportunidades = response.data;
});
};
carregaOportunidades();
<?php
require '../../vendor/autoload.php';
use App\controllers\DB\Conn;
$PDO = new Conn;
$query = $PDO->getConn()->prepare('SELECT * FROM tb_prospect INNER JOIN tb_oportunidade ON tb_prospect.prospectId=oportunidadeCliente');
$query->execute();
while ($row = $query->fetch()) {
$return[]= $row;
}
echo json_encode($return);
This part I’ve managed to solve now returns the data right, I’m able to get the data of the tables with Inner Join. Thanks!
– Ricardo Chomicz