0
I’m creating a website that has information from multiple vendors accessed by an administrator. To display vendor data, I have their names in a table by selecting them from a Mysql database.
Taking the data:
$db = mysqli_connect($servername, $user_db, $pass_db, $nome_db) or die(mysqli_error());
mysqli_select_db($db, $nome_db);
$query_vendor = "SELECT * FROM users WHERE ID != 4";//id temporária do admin
$result = mysqli_query($db, $query_vendor);
$vendorData = mysqli_fetch_array($result);
Arrangement of sellers' names:
<?php
do{
echo "<tr><td><a href='vendorData.php' target='_blank' class='$vendorData[ID]'>$vendorData[USERNAME]</a></td></tr>";
}while($vendorData = mysqli_fetch_array($result));
?>
On the page that I send all sellers, the vendorData.php, I need to show the name of the seller whose link was clicked. My question is: how do I know which link was clicked? I know I can catch the link class with the DOM Document (following this reply), but I don’t know how to define the variable value $classname
to catch the right class.
Thanks, it worked out!
– Sabão