繁体   English   中英

在PHP数组中获取所有行从MySQL数据库到单个表TD?

[英]in php array fetch all rows from mysql database into the single table td?

在php array fetch all rows从mysql数据库array fetch all rows ,所有值都显示到single table td? 我想要这样的结果吗?

1) Small
2) Large
3) Medium

现在的问题是,所有值显示到single table td我想将所有这些值显示到separately table td

查询功能

function get_size($id){
$result=mysql_query("SELECT size FROM mywishlist order by id") 
or die("My Wish Size Problem"."<br/><br/>".mysql_error());
$results = array();
while($row=mysql_fetch_array($result)){
$results[] = stripslashes($row['size'])."<br />";
}
return $results;
}

<td><font style="font-family:Arial,Helvetica,sans-serif;  
font-size:15px; color:#000;">
<?php 
foreach($size as $sizes) {
echo $sizes; }
?></font><input type="hidden" name="size" value="<?php echo $size;?>" /></td>  
<?php foreach ($size as $sizes) { ?>
    <td><font style="font-family:Arial,Helvetica,sans-serif;font-size:15px; color:#000;">
        <?php echo $sizes; ?> 
        </font><input type="hidden" name="size" value="<?php echo $size; ?>" /></td>  
<?php } ?>
<?php foreach ($sizes as $size) { ?>
   <td>
     <font style="font-family:Arial,Helvetica,sans-serif;font-size:15px; color:#000;">
       <input type="hidden" name="size" value="<?php echo $size; ?>" />
     </font>
   </td>  
<?php } ?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM