I have an input where I put a query and it returns the data of the query, but I want the data that I returned to be in a table so that they can be visualized better. Nowadays I get something like this:
first name first name last name first name
and I would like it to come out in a table or something in order to better differentiate the data. This is the code I have to execute the query and show the data.
<?php
session_start();
$conexion = new mysqli("localhost", "root", "", "bbdd");
if ($conexion->connect_errno) {
echo "Fallo al conectar a MySQL: (" . $conexion->connect_errno . ") " . $conexion->connect_error;
}
$consultaa=$_POST["consultaa"];
$queryy = mysqli_query($conexion, "$consultaa");
if (!$queryy){
die('Error: ' . mysqli_error($conexion));
}
if(mysqli_num_rows($queryy) > 0){
$response='success';
}
$column=mysqli_num_fields($queryy);
while ($row = mysqli_fetch_array($queryy))
{
for ($i=0; $i < $column; $i++) {
?>
<td><?php echo $row[$i];?></td>
<?php
}
}
?>