Problem with array returned by sql query

0

Good I have a problem I was comparing in my DB two tables with this code:

SELECT nombre FROM ( SELECT nombre FROM control UNION ALL SELECT nombre FROM becados ) t GROUP BY nombre HAVING COUNT(*) > 1

But when you call it in php, you get it with an array:

[! [array output] [1]] [1]

But that arrangement has another 3 fixes inside.

The problem in itself is how it manages to make those 3 arrangements can perform a count to get an output integer.

He left the code:

session_start();
$name= $_SESSION['user'];
include("../../../base/conexion.php");
$db = new Conexion();
$query_a =mysqli_query($db,"SELECT nombre FROM ( SELECT nombre FROM control UNION ALL SELECT nombre FROM becados ) t GROUP BY nombre HAVING COUNT(*) > 1");
$control=mysqli_fetch_assoc($query_a);
while ($conect_a=mysqli_fetch_array($query_a)) {
    var_dump($conect_a);
    
asked by fernando aguilar 03.06.2018 в 05:07
source

0 answers