I am trying to make a table which displays logs for users that have logged in to the system. The logs are working perfectly,but i want the tables on the final table column to lead me to the member's information. Assigning the member id column value for individual rows so i can use them as 'WHERE' in the queries is the problem
Note The member_id column is a foreign key that links to the member information table the member details on the other hand are in another table where the member_id is a primary key The buttons should take me to the member's information using the member_id of the table row that the button is in
echo "<table border = 2>"; // start a table tag in the HTML
echo "<tr>
<td>Member ID</td>
<td>Date</td>
<td>Time</td>
<td>Member Info</td>
</tr>";
while($row = mysql_fetch_array($result)){ //Creates a loop to loop through results
echo "<tr>
<td>" . $row['member_id'] . "</td>
<td>" . $row['date'] . "</td>
<td>" . $row['time'] . "</td>
<td><input type= 'submit' value = 'Member Information' onsubmit ='memberinfo.php'></td>
//this button is the one to open member information
</tr>";
}
echo "</table>"; //Close the table in HTML
mysql_close();
?>
mysql_*functions. use MySQLi or PDO instead. Here is a good tutorial for PDO.<table>. Use CSS instead. Also, use quotes to enclose all attribute values.