动态行创建php和html
我想从mysql查询生成一个表 桌子应该放在什么地方动态行创建php和html,php,mysql,Php,Mysql,我想从mysql查询生成一个表 桌子应该放在什么地方 pic1 pic2 pic3 name1 name2 name3 ------------------------- pic4 pic5 pic6 name4 name5 name6 请说明如何使用php和html实现这一点 好的,它将显示图片和相应的名称,图片1将是一个图片与图片2,图片3等相同,名称1是一个相应的名称,如orkut或脸谱,我已经尝试了喜欢 代码-
pic1 pic2 pic3
name1 name2 name3
-------------------------
pic4 pic5 pic6
name4 name5 name6
请说明如何使用php和html实现这一点
好的,它将显示图片和相应的名称,图片1将是一个图片与图片2,图片3等相同,名称1是一个相应的名称,如orkut或脸谱,我已经尝试了喜欢 代码- ($i=0;$i<2;$i++)的
{
?>
首先从查询中获取结果并循环它
// first make the connection..., then
$sql = "SELECT xxxxxx";
$result = mysql_query($sql);
foreach($rs = mysql_fetch_assoc()) {
// put the echo statement here with the apropriate html tags.
}
如果你想深入学习,请从sitepoing.com获取此链接
你从什么数据开始;到目前为止你有没有尝试过任何东西;如果有,你到底被困在哪里了?现在,当你说它应该是这样的时候,你是指一个真正的表,还是像那样的纯文本?你的问题到底在哪里,PHP还是HTML?我们通常喜欢解决特定的问题,而不是为某人完成整个任务。
// first make the connection..., then
$sql = "SELECT xxxxxx";
$result = mysql_query($sql);
foreach($rs = mysql_fetch_assoc()) {
// put the echo statement here with the apropriate html tags.
}