I retrieve three pieces of data from my MySQL table and need to pass one of them as a parameter in a link to a dynamically populated .php page and two of them use as the link text.
The echo statement below is not working.
Could you please see what's wrong with it?
Thank you!
<?php
$connection = mysql_connect("server.com","user","password") or die ("Couldn't connect to server.");
$db = mysql_select_db("mydb", $connection) or die ("Couldn't select database.");
$data = "SELECT inventorid, firstname, lastname FROM inventors WHERE taskdate - curdate() = 0";
$query = mysql_query($data) or die("Couldn't execute query. ". mysql_error());
while($data2 = mysql_fetch_array($query)) {
echo "<a href=\"inventorid.php?inventorid=$data2['inventorid']\">$data2['inventorid'] $data2['firstname'] $data2['lastname']</a>\n";
}
?>