Page 1 of 1

View the detail based on link provided from database

Posted: Fri Dec 16, 2011 12:42 am
by aquilina
I having a problem viewing the right data from database.. when employer advertise their job, it will appear at the main page of the site.
Here is the coder for displaying the vacancy at the main page..

Code: Select all

<div class="h3"><?php echo $servername; ?> Features</div>
<div class="mainbox">
<ul id="features">
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("job_seeks", $con);
$result = mysql_query("SELECT * FROM employer_user");
while($row = mysql_fetch_array($result))
  {
  echo "<li><a href="."?page=job_detail".">".$row['business_name']."</a></li>";
  }
echo "</tbody>";
echo "</table>";

mysql_close($con);
?>
</ul>
</div>
From the code above employee need to click the link that provided to view the all detail about the vacancy..

Below is the code where the link are connected when employee clicked the link..

Code: Select all

<html>
<body>
<div id="main">
<center>
<div class="h3">Job_Detail</div>
<div class="mainbox">
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("job_seeks", $con);
$result = mysql_query("SELECT * FROM employer_user");
$row = mysql_fetch_array($result);
?>

<table cellspacing=0 cellpadding=5>
		<tr><td class=listtitle colspan=2><center><span class='title2'></span></center></td></tr>
		<?php
		echo "
		<form method=\"POST\">
		<tr><td class=list align=left><b>Username :</b></td><td class=list> ".$row['username']."<br></td></tr>
		<tr><td class=list align=left><b>Business Name :</b></td><td class=list> ".$row['business_name']."<br></td></tr>
		<tr><td class=list align=left><b>Address :</b></td><td class=list> ".$row['address']."<br></td></tr>
		<tr><td class=list align=left><b>Location :</b></td><td class=list> ".$row['location']."<br></td></tr>
		<tr><td class=list align=left><b>City/Town :</b></td><td class=list> ".$row['city_town']."<br></td></tr>
		<tr><td class=list align=left><b>Email :</b></td><td class=list> ".$row['email']."<br></td></tr>
		<tr><td class=list align=left><b>Phone Number :</b></td><td class=list> ".$row['phone']."<br></td></tr>
		<tr><td class=list align=left><b>Qualification :</b></td><td class=list> ".$row['qualification']."<br></td></tr>
		<tr><td class=list align=left><b>Salary :</b></td><td class=list> ".$row['salary']."<br></td></tr>
		<tr><td class=list align=left><b>Description :</b></td><td class=list> ".$row['company_description']."<br></td></tr>";

		echo "</td></tr></table>";
		echo "<p><center><a href="."?page=application&employer_id=".$row['employer_id']."><b>Apply</b></a>
				</center>";
?>
</div>
</center>
</div>
</body>
</html>
My problem here is 1st i only try to advertise one vacancy.. then and viewed the job detail from the link provided at the main page.. yes i can view it.. Then i tried to advertise another vacancy.. Then the another vacancy appear at the main page. When i wanted to view the detail, it showing me the details of the previous vacancy job detail.. anyone can guide me how to do this? so that each linked vacancy will view his own detail..

Re: View the detail based on link provided from database

Posted: Fri Dec 16, 2011 2:22 am
by aquilina
solved