View username problem
Posted: Thu Dec 15, 2011 10:43 am
I having a problem with viewing a username from another table.. i got 3 table in my database.. employee_user, employer_user and application table. my problem here is at application table..
Below is the code where employee applying the job
[/syntax]
My problem here is i to view employee_user detail by using application_employee_id from application table. as a employer, they wanted to view whos apply for they job..
Below is code for employer_user to view employee_user that apply.. i stuck at this code btw..
Below is the code where employee applying the job
Code: Select all
[syntax=php]<div class="h3">Application</div>
<div class="mainbox">
<ul id="features">
<?php
if (isset($_SESSION['usernamejob']))
echo "<br />You already appplied for the job<br />";
else
die ('You must be logged in!');
?>
<?php
$employer_id = $_GET['employer_id'];
if (isset($_SESSION['userid']))
$conn = mysql_connect("localhost","root","") or die ("Cannot connect!");
mysql_select_db("job_seeks") or die("cannot find the db");
$date = date("Y-m-d");
$query = mysql_query("SELECT * FROM application") or die(mysql_error());
$sql = 'INSERT INTO application (application_job_id, application_employee_id, date) VALUES ("'.$employer_id.'", "'.$_SESSION['employee_id'].'", "'.$date.'")';
$result = mysql_query($sql) or die(mysql_error());
?>
</ul>
</div>
My problem here is i to view employee_user detail by using application_employee_id from application table. as a employer, they wanted to view whos apply for they job..
Below is code for employer_user to view employee_user that apply.. i stuck at this code btw..
Code: Select all
<div id="main">
<div class="h3">Check Application</div>
<div class="mainbox">
<?php
if (isset($_SESSION['employer_id']))
$con = mysql_connect("localhost","root","") or die (mysql_error());
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("job_seeks", $con);
$userid = $_GET['usernamejob'];
$result = mysql_query("SELECT * FROM application WHERE application_job_id=$userid");
while($row = mysql_fetch_array($result))
{
echo "<li><a href="."?page=job_detail".">".$row['application_job_id']."</a></li>";
}
echo "</tbody>";
echo "</table>";
mysql_close($con);
?>
</div>
</div>