2
Good afternoon
I have the following code
<?php
include_once("con.php");
$pdo = conectar();
$data = file_get_contents("php://input");
$data = json_decode($data);
$idempresa = $data->idempresa;
$subcategoria = "Recebimento";
$buscaContaEntrada=$pdo->prepare('SELECT * FROM conta WHERE empresa_idempresa=:idempresa AND subcategoria=:subcategoria');
$buscaContaEntrada->bindValue('idempresa', $idempresa);
$buscaContaEntrada->bindValue('subcategoria', $subcategoria);
$buscaContaEntrada->execute();
while ($linha=$buscaContaEntrada->fetch(PDO::FETCH_ASSOC)) {
$return[] = array(
'idconta' => $linha['idconta'],
'conta' => utf8_encode($linha['conta']),
'idsubcategoria' => utf8_encode($linha['subcategoria_idsubcategoria']),
);
}
echo json_encode($return);
?>
But I need to take the given idsubcategory, do another select, in the database, and the result, play within $Return... How can I do this?
Let me try to understand: you want to take the value of the key
idsubcategoria
and make an appointmentsql
with that amount ?– MagicHat
No, this I already do...@Magichat. What I want to do is unite this $Return[] to another one that I will mount.
– GustavoSevero
Could you add how is Aria (var_dump) and how you want it to be? I think this would help.
– Inkeliz