<?
$result=mysql_query("select * from registration order by r_id desc") or die (mysql_error(). " : ".mysql_errno());
while($row=mysql_fetch_object($result)){
if($r_id!=""){
$result2=mysql_query("select * from registration where r_id='$r_id'") or die (mysql_error(). " : ".mysql_errno());
$row2=mysql_fetch_object($result2) ;
echo $w;
}
elseif(empty($r_id))
{
$result=mysql_query("select * from registration order by r_id desc") or die (mysql_error(). " : ".mysql_errno());
$row2=mysql_fetch_object($result) ;
if($r_id!=""){
$result2=mysql_query("select * from registration where r_id='$r_id'") or die (mysql_error(). " : ".mysql_errno());
$row2=mysql_fetch_object($result2) ;