//连接数据库......省略
$rs = mysql_query("select * from tablename")
while($myrow = mysql_fetch_array($rs)){
?>
<table>
<tr>
<td><?php echo $myrow['id']?></td>
<td><?php echo $myrow['name']?></td>
<td><?php echo $myrow['age']?></td>
<td><?php echo $myrow['email']?></td>
</tr>
</table>
<?php
}
?>
PreparedStatement pstm = conn.prepareStatement("select value from test")
ResultSet rs=null
rs=pstm.executeQuery()
int i =0
while(rs!=null&&rs.next())
{
System.out.println(i+":"+rs.getString("value"))
i++
}
jdbc就可以!
用循环保存int index =0
while(rs.next){
Object obj = rs.get(index ++)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)