怎么能让数据库里面的题目随机抽取. 这是我的asp文件.

来源:百度知道 编辑:UC知道 时间:2024/05/13 10:01:15
<html>
<head><title>题目</title></head>
<body onLoad="window.setTimeout('getSecs()',1)">
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>第一关:政治与行政学院</td>
</tr>
<tr>
<td align="right"><script language="JavaScript">
<!-- Begin
startday = new Date();
clockStart = startday.getTime();
function initStopwatch() {
var myTime = new Date();
return((myTime.getTime() - clockStart)/1000);
}
function getSecs() {
var tSecs = Math.round(initStopwatch());
var iSecs = tSecs % 60;
var iMins = Math.round((tSecs-30)/60);
var sSecs ="" + ((iSecs > 9) ? iSecs : "0" + iSecs);
var sMins ="" + ((iMins > 9) ? iMins : "0" + iMins);

你错了
你要得先有个自增列id
然后在页面弄个变量取到随即数a
最后select * from table where id=a
麻烦的是要是删除过数据就不行了.
或者你用指针,就不会有这种麻烦了