日期:2014-05-17 浏览次数:20553 次
<?php include_once('conn.php'); $result = mysql_query("SELECT p_class FROM Product group by p_class limit 40"); mysql_data_seek($result, 0); while ($row=mysql_fetch_row($result)) { for ($i=0; $i<mysql_num_fields($result); $i++ ) { ?> <table border="1"> <tr> <td><?php echo "$row[$i]";?></td> <td>more</td> </tr> <tr> <td colspan="2">********</td> </tr> </table> <table border="1"> <tr> <?php $result2 = mysql_query("SELECT * FROM Product where p_class=$row[$i] limit 0,4"); while ($row=mysql_fetch_row($result2)) { ?> <td> <table border="1"> <tr><td> <img src=<?php echo $row['pic'];?> />//这里报错,说写法不对 </td></tr> <tr><td> <?php echo $row['p_class'];?>//这里报错,说写法不对 </td></tr> <tr><td> <?php echo $row['p_name'];?>//这里报错,说写法不对 </td></tr> </table> <br /> </td> <?php } ?> </tr> </table> <?php } } mysql_free_result($result); mysql_free_result($result2); mysql_close($conn); ?>