<html>
<head>
<meta charset="utf-8">
<title>mf</title>
<script src="jquery.js"></script>
<script src="ex05.js"></script>
</head>
<body onload="sample()">
<p id="memo">準備中</p>
</body>
</html>
function sample(){
$.get( "ex05.php", function( data ) {
var artist=data.split(",");
var str;
var s;
str="<table>";
for(s=0;s<artist.length;s++){
str=str+"<tr><td>"+artist[s]+"</td></tr>";
}
str=str+"</table>";
$( "#memo" ).html(str);
});
}
<?php
require('calldata.php');
$result = mysql_query("SELECT y,a FROM mf where y=2012");
$sx=0;
while ($row = mysql_fetch_assoc($result)) {
$sx=$sx+1;
$artist[$sx]=$row['a'];
}
$number=$sx;
mysql_close($link);
for($sx=1;$sx<$number;$sx++){
print($artist[$sx]);
print(",");
}
print($artist[$number]);
?>
最終更新:2013年12月06日 12:52