07-03-2009, 01:57 PM
|
#17 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
Thanks everybody for the reply.. my code is working fine as i wanted. But have a small error again. when i click n the first postion it is not taking the jobid. but when i click on the second one then it is taking the first job id and so on.
What exactly is the error.
My code goes this way
PHP Code:
<?php
$nickname = $_POST['company_nickname'];
include 'connect_to_databaseemployer.php';
//To fetch all the sub-employer usernames from sub_employer if the company nickname matches
$sql_stmt = "SELECT * FROM database name WHERE company_nick='$nickname'";
$result = mysql_query($sql_stmt, $conn) or die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
$username = $row["username"];
}
//To check whether the user has any posting.If yes,display the postings sorted by date of posting
$sql_stmt1 = "SELECT * FROM database nameWHERE posted_by like '%$nickname%' ORDER BY job_posted_on DESC";
$result1 = mysql_query($sql_stmt1, $conn) or die(mysql_error());
echo "<table border='1' CELLPADDING=5 STYLE='font-size:13px'>";
echo "<tr> <th><H3>Posted by</h3></th> <th><H3>Position</H3></th> <th><H3>Job Level</H3></th><th><H3>Posted on</h3></th></tr>";
while ($row1 = mysql_fetch_assoc($result1))
{
echo "<tr><td>";
echo $row1["posted_by"];
echo "</td><td>";
echo '<a href="http://www.konanakunteokkoota.org/applyhereforjob.php?username='.$username.'&jobid='.$postid.'">'.$row1["position"].'</a>';
echo "</td><td>";
echo $row1["job_level"];
echo "</td><td>";
echo $row1["job_posted_on"];
echo "</td></tr>";
$postid = $row1["post_id"];
echo "$postid";
}
echo "</table>";
?>
|
|
|
|