0
I have the code below that was to print on the screen the data of the two tables of select, but it is only printing the name.
Follows the code:
<?php
require 'conexao.php';
ob_start();
error_reporting(E_ALL);
ini_set('display_errors','On');
require_once('firephp-core-0.4.0/lib/FirePHPCore/FirePHP.class.PHP');
$firephp = FirePHP::getInstance(true);
$firephp ->info("Debugando");
$firephp ->info($_POST, '\$_POST');
$Nome = $_POST['Data']['Consulta']['nome'];
$firephp ->info($Nome, 'Nome');
if (($Nome == null) || ($Nome = '')){
$retorno = array('codigo' => "0", 'mensagem' => 'Preencha seu e-mail!');
echo json_encode($retorno);
exit();
}else{
$conexao = conexao::getInstance();
$sql = 'SELECT pessoa.*, contato.* FROM pessoas_inter AS pessoa inner join contatos_inter as contato on(contato.id_contato=pessoa.id_contato) where nome LIKE :nome';
$stm = $conexao->prepare($sql);
$stm->bindValue(':nome', '%'.$Nome.'%');
$stm->execute();
$clientes = $stm->fetchAll(PDO::FETCH_OBJ);
$firephp ->info($clientes, '\$clientes');
echo json_encode($clientes);
};
your query is returning data?
– andrepaulo
only the 'name' of the personal table
– Lucila Nascimento