<?php
$total=mysql_query("select count(*) from course");
$randno=rand(1,$total);$couno=mysql_query("select couno from course where couno=$randno");
$couname=mysql_query("select couname from course where couno=$randno");
$kind=mysql_query("select kind from course where couno=$randno");
$credit=mysql_query("select credit from course where couno=$randno");
$teacher=mysql_query("select teacher from course where couno=$randno");
$departname=mysql_query("select departname from course,department where course.departno=department.departno and couno=$randno");
$schooltime=mysql_query("select schooltime from course where couno=$randno");
$limitnum=mysql_query("select limitnum from course where couno=$randno");
?>出错:Warning: rand() expects parameter 2 to be long, resource given in D:\AppServ\www\PHP xk os\rand_course.php on line 3