0
Answer

Two operations to do: doing filter from Table1 displaying on Table2

Hi Sirs,

I need to resolv this logic:

I have two tables: Table1 (where to pick-up name. one by one until at the last name to filter on Table2).

Table2 (This table will ONLY display during 5 seconds records filtered then will pass will display the filter of the next name from the Table1).

These codes are afected to filter records of Table2 inserting name manually into input. But I would love to see himself pick-up name one by one display the filtering action on Table2 until the last name from Table1

Table1

name year

______________

steve - 2026

kalamah - 2026

anderson - 2026

Table2 (where records will be filtered)

<?php

if(isset($_POST['search']))

{

include('testdb.php');

$valueToSearch = $_POST['valueToSearch'];

$query = "SELECT * FROM india_company WHERE name = '".$valueToSearch."'";

$search_result = filterTable($query);

}

else {

$query = "SELECT * FROM india_company";

$search_result = filterTable($query);

}

function filterTable($query)

{

$connect = mysqli_connect("x","xx","xxx","xxx");

$filter_Result = mysqli_query($connect, $query);

return $filter_Result;

}

?>

<center><form action="page_of_table2.php" method="post">

<label>Name:</label><br><input type="text" name="valueToSearch" placeholder="search name">

<input type="submit" name="search" id="search" class="search" value="Filter">

</form></center>