01.
<?
require_once
"connectdb.php"
; ?>
02.
<!DOCTYPE html>
03.
<html>
04.
<head>
06.
<script>
07.
$(document).ready(
function
(){
08.
09.
$(
'p'
).each(
function
(){
10.
$(this).hide();
11.
});
12.
13.
$(
"button"
).click(
function
(){
14.
var
num=$(this).attr(
'rel'
);
15.
$(
'p'
).each(
function
(){
16.
$(this).hide();
17.
});
18.
$(
'#p'
+num).show();
19.
});
20.
21.
});
22.
</script>
23.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
></head>
24.
<body>
25.
26.
<?
27.
$today_zean
=
date
(
'Y-m-d'
);
28.
$sqlprg
=
"select * from membertb order by id desc"
;
29.
$resultpg
= mysql_query(
$sqlprg
)
or
die
(mysql_error());
30.
while
(
$rowg
= mysql_fetch_array(
$resultpg
))
31.
{
32.
$idmember
=
$rowg
[
'id'
];
33.
$name
=
$rowg
[
'name'
];
34.
$detail
=
$rowg
[
'detail'
];
35.
?>
36.
37.
<button rel=
"<? echo "
$idmember
"; ?>"
><?
echo
"$name"
; ?></button><br>
38.
<p id=
"p<? echo "
$idmember
"; ?>"
><?
echo
"$detail"
; ?></p>
39.
40.
<? } ?>
41.
</body>
42.
</html>