we are given a database, and we had to list the year of review, this is to be a hypertext link which when clicked will pass the reviewid(which is stored in the reviews table in the database) to the viewReview.php page
the code I have for passing the reviewid to viewReview.php is this:
Then in the viewReview.php we had to display Employee informations according to the reviewid.
But the problem is when I clicked on the link, it takes me to the viewReview.php page, it just displays all the Employee informations but it's not according to the reviewid. This is my code in the viewReview.php
I'm thinking I have to add something in my viewReview.php, something like reviewid=...., but I'm not sure what to add...
can anyone help please.
the code I have for passing the reviewid to viewReview.php is this:
Code:
<td><a href="viewReview.php?reviewid=<?php echo $row1['reviewid'] ?>"><?php echo $row1["reviewYear"] ?></a></td>
But the problem is when I clicked on the link, it takes me to the viewReview.php page, it just displays all the Employee informations but it's not according to the reviewid. This is my code in the viewReview.php
Code:
<?php session_start(); $conn = mysql_connect("localhost", "TWA2", "test"); mysql_select_db("performancereview", $conn) or die ('Database not found ' . mysql_error() ); $sql = "SELECT employee.empid, jobs.jobtitle, employee.extension, departments.departmentname, reviews.supervisorid, reviews.reviewYear FROM employee, jobs, reviews, departments WHERE jobs.jobid=employee.jobid AND employee.empid=reviews.empid "; $rs = mysql_query($sql, $conn) or die ('Problem with query' . mysql_error()); ?> <table border="1"> <tr> <th>Employee id</th> <th>Job Title</th> <th>Phone Extension</th> //rest of the <th> </tr> <?php while ($row = mysql_fetch_array($rs)) { ?> <tr> <td><?php echo $row["empid"]?></td> <td><?php echo $row["jobtitle"]?></td> <td><?php echo $row["extension"]?></td> //rest of the <td> </tr> <?php } mysql_close($conn); ?> </table>
can anyone help please.
Comment