Click here to Skip to main content
16,014,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how i can disply recored frm database of respective person when we click by using id

following code are disply name only bt when we click on that name dispaly whole information of that person disply on same page ...how done these using id...?


XML
<?php
 $res=mysql_query("SELECT name,exp FROM app LEFT JOIN jobs ON(jobs.id=app.jid) ORDER BY app.id DESC");

        $i=1;
        if(!$res)
        die('invaild query:'.mysql_error());
        while($row1=mysql_fetch_array($res))


  {



  ?>

        <div class="HyperGridWrapper"  style=" overflow: hidden; height: 39px; width: 200px;">
<input type="checkbox" id="ctl00_Split_LP_ctl01_grdContactsCheckAll" name="ctl00$Split$LP$ctl01$grdContactsCheckAll">
  <?php

  $prop_id = $row1['name'];

  echo "<a href=\"applications.php?prop_id=".$prop_id."\">";
  echo $row1['name']?>,
  Exp:<?php echo$row1['exp']?>
  yr<br>  </div></a>

  <?php
  }

mysql_close($con);
?>
</div>
Posted

1 solution

try this...
HTML
 $res=mysql_query("SELECT app.jid,app_name,app_exp FROM app LEFT JOIN jobs ON(jobs.id=app.jid) ORDER BY app.id DESC");
 
        $i=1;
        if(!$res)
        die('invaild query:'.mysql_error());
        while($row1=mysql_fetch_array($res))

  {
	  
  ?>
 
        <div class="HyperGridWrapper" style=" overflow: hidden; height: 39px; width: 200px;">
<input type="checkbox" id="ctl00_Split_LP_ctl01_grdContactsCheckAll" name="ctl00$Split$LP$ctl01$grdContactsCheckAll">
   
  $prop_id = $row1['jid'];
 
  echo "<a href="\"index.php?v=".$prop_id."\"">";
  echo $row1['app_name']?>,
  Exp:<?php echo$row1['app_exp']??>
  yr<br>  </br></a></div>
 
    }
 
mysql_close($con);
?>


	if($_GET['v']!="")
	{
		$app_id = $_GET['v'];
?>
<div style="width:250px; height:100px; border:solid 1px #000;">
		        	$res2=mysql_query("SELECT * FROM app,jobs where jobs.id=app.jid and jid='".$app_id."' ");
			while($row2=mysql_fetch_array($res2))
			{
				echo "Name: ".$row2['app_name'].", Exp: ".$row2['app_exp']."<br />";
				echo "Job: ".$row2['job_name']."-".$row2['job_desc']."<br />";
			}
		?>
</div>
	}
?>


hope I am correct
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900