1

array fetch all rows在来自mysql数据库的php中,所有值都显示在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>  
4

2 回答 2

0
<?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 } ?>
于 2013-03-11T10:05:12.953 回答
0
<?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 } ?>
于 2013-03-11T10:11:55.850 回答