I am creating a user table with data from a query, later I try to obtain the id of some field of the users that is selected and I send it to another page to show all the fields of said selection, but I don't know how to do it.
<?php
include("conn.php");
$con = connect();
echo
'
<table class="table table-hover">
<tr>
<th scope="col">ID</th>
<th scope="col">RFC</th>
<th scope="col">Razón Social</th>
<th scope="col">Nombre Comercial</th>
<th scope="col">Representante Legal</th>
<th scope="col">Teléfono</th>
<th scope="col">Correo</th>
</tr>
';
$accion = mysqli_real_escape_string($con,$_POST['accion']);
if($accion == 4)
{
$mi_busqueda = mysqli_real_escape_string($con,$_POST['mi_busqueda']);
$resultados = mysqli_query($con,"SELECT * FROM naucalpan WHERE
rfc LIKE '%$mi_busqueda%'
OR prop_rep LIKE '%$mi_busqueda%'
OR business_name LIKE '%$mi_busqueda%'
OR tradename LIKE '%$mi_busqueda%'
OR mail LIKE '%$mi_busqueda%'
LIMIT 50");
while($consulta = mysqli_fetch_array($resultados))
{
echo
'
<tr>
<td><a href="oneClient.php?id="'.$consulta["id_naucalpan"].'>'.$consulta['id_naucalpan'].'</a></td>
<td><a href="oneClient.php">'.$consulta['rfc'].'</a></td>
</tr>
';
}
}
echo '</table>';
Finally I try to receive the variable to be able to perform the query:
<?php
include("conn.php");
$con = connect();
$id = mysqli_real_escape_string($con,$_GET['id']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
here we go
<?php echo "hello".$id;
?>
<?php echo $_GET["id"]; ?>
</body>
</html>
But i only recieve here we go hello