我試圖讓它看看mysql行,如果行等於左邊,然後繪製此表。調用/張貼到表
塊有以下幾點: id
,title
,file
,side
$queryblocks = mysql_query("SELECT * FROM blocks ORDER BY id") or die(mysql_error());
while($data = mysql_fetch_array($queryblocks)) {
//select blocks
$blocktitle = $data["title"];
$blockcontent = $data["file"];
$blockside = $data["side"];
}
if($blockside = "Left"){
//START LEFT BLOCKS
echo "<table bgcolor=\"#141414\" width=\"150\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" valign=\"left\">
<tr>
<td width=\"150\" height=\"22\" background=\"cpstyles/TeamofGoD/sidebar.gif\"><center><font color=\"#ffffff\">$blocktitle</font><center>
</td>
</tr>
<tr>
<td width=\"150\" background=\"cpstyles/TeamofGoD/block-bg.gif\"><center>$blockcontent</center>
</tr>
<tr>
<td width=\"150\"><center><img src=\"cpstyles/TeamofGoD/sidebar2.gif\"></center></td>
</tr>
</table><br>";
}
而你的問題是? – Rikesh
我可以讓它只發佈一個區塊,我只是不能讓它繼續發佈所有在「柱」下的「左」的區塊。 – user2002716
只需將您的html代碼移動到循環中怎麼樣? – Rikesh