the next function what it does is search for a typed word and show me the possible matches (search engine). When I show the matches I am doing it through a href and I would like to store the href in a php variable, to keep the searches that are made. My idea is to use the options where the user clicks, but there may be several options, not just one.
<?php
if(!isset($_POST['search'])) exit('No se recibió el valor a buscar');
require_once 'conexion.php';
function search()
{
$mysqli = getConnexion();
$search = $mysqli->real_escape_string($_POST['search']);
$query = "SELECT sintomas_resp FROM sintomas WHERE sintomas_resp LIKE '%$search%' ";
$res = $mysqli->query($query);
while ($row = $res->fetch_array(MYSQLI_ASSOC)) {
echo "<p><a href='#'>$row[sintomas_resp]</a></p>";
}
}
search();