Hi,
Tell me ,when we go to the edit page by a link then element should be selected which have been entered in the database in the issue date field becouse there are 3 dropdown.Tell me what is the code for it coz i am in trouble.
The code is:-
<?
session_start();
if(trim($_SESSION[“login_memberid”])==””)
header(“location:index.php”);
include(“header.php”);
include(“label.php”);
include(“connection.php”);
print'<body bgcolor=”#F8E1D0″ topmargin=”0″ leftmargin=”0″>’;
$query=”SELECT * FROM books WHERE book_id='”.$_GET[‘book_id’].”‘”;
$result=mysql_query($query);
$fetch=mysql_fetch_array($result);
$book_id=$fetch[“book_id”];
$book_name=$fetch[“book_name”];
$author_name=$fetch[“author_name”];
$publisher_name=$fetch[“publisher_name”];
$no_of_copies=$fetch[“no_of_copies”];
$issue_date=$fetch[“issue_date”];
$status=$fetch[“status”];
?>
<FORM METHOD=POST ACTION=”query_update.php” name=”edit”>
<TABLE align=”center” width=”80%” cellspacing=”5″ cellpadding=”0″ border=”0″ >
<TR>
<TD>
<TABLE width=”60%” align=”center” cellspacing=”0″ cellpadding=”0″ border=”0″>
<TR>
<TD width=”24px” align=left><IMG SRC=”Images/new_left.gif” WIDTH=”25″ HEIGHT=”25″ BORDER=”0″ ALT=””></TD>
<TD COLSPAN=2 bgcolor=”#F28F45″> </TD>
<TD width=”24px” align=”right”> <IMG SRC=”Images/new_right.gif” WIDTH=”25″ HEIGHT=”25″ BORDER=”0″ ALT=””></TD>
</TR>
<TR HEIGHT=40 >
<TD border=0 style=”border-left:1px solid #F28F45;”> </TD>
<TD align=RIGHT ><B> <font face=”Times New Roman” color=”BLACK”> Book Name </font> </B> </TD>
<TD align=”left”><INPUT TYPE=”text” NAME=”book_name” value=<?=$book_name?> size=”27″ ></TD>
<TD style=”border-RIGHT:1px solid #F28F45;”> </TD>
</TR>
<TR HEIGHT=40 >
<TD border=0 style=”border-left:1px solid #F28F45;”> </TD>
<TD align=RIGHT ><B> <font face=”Times New Roman” color=”BLACK”> Author Name </font> </B> </TD>
<TD align=”left”><INPUT TYPE=”text” NAME=”author_name” value=<?=$author_name?> size=”27″ ></TD>
<TD style=”border-RIGHT:1px solid #F28F45;”> </TD>
</TR>
<TR HEIGHT=40 >
<TD border=0 style=”border-left:1px solid #F28F45;”> </TD>
<TD align=RIGHT ><B> <font face=”Times New Roman” color=”BLACK”> Publisher Name </font> </B> </TD>
<TD align=”left”><INPUT TYPE=”text” NAME=”publisher_name” value=<?=$publisher_name?> size=”27″ ></TD>
<TD style=”border-RIGHT:1px solid #F28F45;”> </TD>
</TR>
<INPUT TYPE=”hidden” NAME=”no_of_copies” value=”1″>
<?
print'<TR HEIGHT=40 >
<TD border=0 style=”border-left:1px solid #F28F45;”> </TD>’;
print'<TD align=RIGHT ><B> <font face=”Times New Roman” color=”BLACK”> Issue Date </font> </B> </TD>’;
?>
<TD align=”Left”><select NAME=”issue_day” >
<?
while($d<=31)
{
print”<option>$d”;
$d++;
}
print’ </select>
<select NAME=”issue_month” >’;
while($m<=12)
{
print”<option>$m”;
$m++;
}
print'</option>
</select>
<select NAME=”issue_year”><option></option>’;
$y=2005;
while($y<=2010)
{
print”<option>$y”;
$y++;
}
print'</option>
</select>
</TD>
<TD style=”border-RIGHT:1px solid #F28F45;”> </TD>
</tr>
<br>’;
$query=”select * from members”;
$result=mysql_query($query);
print'<TR HEIGHT=40 >
<TD border=0 style=”border-left:1px solid #F28F45;”> </TD>
<TD align=RIGHT ><B> <font face=”Times New Roman” color=”BLACK”> AssignedTo </font> </B> </TD>’;
?>
<TD><SELECT NAME=”status”><option value=0>—-</option>
<?
while($row=mysql_fetch_array($result))
{
if($row[“member_id”]==$status)
{
?>
<option SELECTED value=”<?=$row[‘member_id’]?>”><?=$row[‘login_memberid’]?></option>
<?
}
else
{
?>
<option value=”<?=$row[‘member_id’]?>”><?=$row[‘login_memberid’]?></option>
<?
}
}
print'</SELECT> </TD>
<TD style=”border-RIGHT:1px solid #F28F45;”> </TD>
</TR>’;
print'<TR HEIGHT=40>
<TD style=”border-left:1px solid #F28F45;”> </TD>
<TD> </TD>
<TD align=”left”><INPUT TYPE=”submit” value=”Save”><INPUT TYPE=”hidden” name=”book_id” value=’.$_GET[‘book_id’].’><INPUT TYPE=”hidden” name=”flag” value=6><INPUT TYPE=”button” value=”Cancel” onclick=”javascript:location.href=’books.php'”></TD>
<TD style=”border-RIGHT:1px solid #F28F45;”> </TD>
</TR
<TR>
<TD><IMG SRC=”Images/Bottom_left.gif” WIDTH=”25″ HEIGHT=”25″ BORDER=”0″ ALT=””></TD>
<TD COLSPAN=2 bgcolor=”#F28F45″> </TD>
<TD align=”left”><IMG SRC=”Images/Bottom_right.gif” WIDTH=”25″ HEIGHT=”25″ BORDER=”0″ ALT=””></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>’;
?>
<?
include(“footer.php”);
?>
</body>
Plzz give me reply quickly.