Forum Moderators: coopster
<?php
// listing script
// connect to the server
mysql_connect( 'localhost', 'aamir', 'abc' )
or die( "Error! Could not connect to database: " . mysql_error() );
// select the database
mysql_select_db( 'mkats' )
or die( "Error! Could not select the database: " . mysql_error() );
// get the id from the URL request
$id = $_REQUEST['id'];
// retrieve the row from the database
$query = "SELECT * FROM `tajneed` WHERE `first_name` LIKE '$id'";
$result = mysql_query( $query );
// print out the results
if( $result && $tajneed = mysql_fetch_object( $result ) )
{
// print out the info
$firstName = $tajneed -> first_name;
$lastName = $tajneed -> last_name;
$fname = $tajneed -> father_name;
$dob = $tajneed -> dob;
$hno = $tajneed -> house_no;
$bno = $tajneed -> block_no;
$sector = $tajneed -> sector;
$phh = $tajneed -> phone_home;
$phm = $tajneed -> mobile_no;
$bg = $tajneed -> blood_group;
$education = $tajneed -> education;
$mstat = $tajneed -> m_status;
$will = $tajneed -> will_no;
$ned = $tajneed -> noor;
$wa = $tajneed -> work_address;
$wt = $tajneed -> work_type;
$phw1 = $tajneed -> work_phone1;
$phw2 = $tajneed -> work_phone2;
$sc = $tajneed -> school_college;
$email = $tajneed -> email;
$salary = $tajneed -> salary_pm;
?>
<table border="1" cellpadding="3" cellspacing="3">
<tr>
<th align="left">First Name</th>
<td align="left"><?php echo ucwords($firstName)?></td>
</tr>
<tr>
<th align="left">Last Name</th>
<td align="left">
<?php echo ucwords($lastName)?>
</td>
</tr>
<tr>
<th align="left">Fathers Name</th>
<td align="left">
<?php echo ucwords($fname)?>
</td>
</tr>
</table>
<?php
}
else
{
die( "Error: Value can not found in database! ".mysql_error() );
}
?>
</body>
</html>