我试图让它查看 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>";
}