Pain, So...

用php+mysql写一个刷新页面显示不同的内容

用php+mysql写一个刷新页面显示不同的内容

1
2
3
4
5
6
7
8
9
10
11
12
<?
$conn=mysql_connect("localhost","user","pwd");
$sql="select * from tab where 1";
result=mysql_db_query("database_name",sql);
row_num=mysql_num_rows(result);
rand=rand(0,row_num);
mysql_data_seek(result, rand);
row=mysql_fetch_assoc(result);
echo "<pre>";
print_r($row);
echo "/<pre>";
?>