I'd like to pass specific Uniq ID from MySQL row to the another .php page. But it still takes 1st 20 records and pass the last value instead of just that one existing on the line. Uniq ID is created by autoireacment and its specific for every so I'd like to pass ID=5 if I click the link on the line 5. Any ideas please?
the file with mysql table:
session_start();
require "login.php";
$con= mysqli_connect($server, $user, $pass, $db);
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM $table");
echo "<table border='1'>
...
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Uniq'] . "</td>";
echo "<td>" . '<a href="invoice/index2.php">Create Invoice</a>';setcookie("test", $row['Uniq'],time()+3600) . "</td>";
echo "<td>" . $row['Date'] . "</td>";
...
}
echo "</table>";
mysqli_close($con);
2nd file
session_start();
require "../login.php";
echo $_COOKIE["test"];