hello i tried to fix the code with my code
what i must to do to make it read my Recordset
and calculate the resulte???
here is my code that i get the data in it to prepare the admin to update the data or delet it
and if ther i get the data i put it in a table
so what if there is 1000 itemes and i dont want all of that come in 1 page
here is
*****************
<%@ Language = "VBScript" %>
<!--#include file="Conn.inc" -->
<%
response.buffer = true
'** Getting the data from the db and order the data by Id des to get the new at first.
sql ="select * from Lesson_cat ORDER BY id desc"
'**Makeing a Record Set to get the Data in it and make it Execute
set rs=conn.execute(sql)
'** Now we are making a Var Id from the data has come from the db and Select statment cuz we will use the Id in the
'** it here to make it go with the form
id = rs( "id" )
'** Now we will make the cases when we want to get Data
'* the first case when we dont have any data in the Db.!!
if (rs.bof and rs.eof) then
'**here is the resulte when the rs cannt find any data to view it ..
Response.Write("<br><br><center> <font face=""verdana"" size=""2"" color=""red"">Sorry , There is no Category to be able to update it.!!<br><br><a href=""addcat.asp"">add category</a>")
'** and now Here we go with the other case when we find a data to view...
else
rs.movefirst
'**Now we will draw a table and put the data in it .!!
%>
<html>
<head>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Language" content="en-us">
</head>
<body>
<center><% do while not rs.eof %>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" bgcolor="#F3F3F3">
<tr>
<td width="100%">
<table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="15%" align="center" height="27"><b>
<font face="Verdana" size="2" color="#FF9900">Category name</font></b></td>
<td width="26%" align="center" height="27"><b>
<font face="Verdana" size="2" color="#FF9900">Description</font></b></td >
<td width="26%" align="center" height="27"><b>
<font face="Verdana" size="2" color="#FF9900">The Action</font></b></td>
</t r>
<!--the data-->
<tr >
<td width="15%" height="47">
<center><div id="red">
<%=rs("name")%>
</div></center>
</td>
<td width="26%" height="47" align="center"><div id="normal">
<%=rs("des")%>
</div>
</td>
<td width="26%" height="47">
<p align="center">
<form method="POST" action="deletcataction.asp?id=<%=rs("id")%>">
<p align="center">
<a href="updatecatform.asp?id=<%=rs("id")%>">Update</a>
|
<input type="submit" value="delete" name="B1" onclick="return confirm('are you sure you want to delet you will delete the lessons under the category too.')" style="font-size: 10px; font-family: Tahoma">
</p >
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
rs.movenext
loop
%>
</body>
</html>
<%
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>