0

我有以下代码,但无法挽救我的生命。它只需要具有 3 个链接之一,具体取决于它来自哪个部门。如果部门 = 1,则 URL1.com 等等。

<?php
// Make a MySQL Connection
mysql_connect("localhost","dfasrgasdg","asdgasdgasdg") or die(mysql_error());
mysql_select_db("asdgasdgash") or die(mysql_error());


// Get all the data from the "example" table
$album = mysql_query("SELECT * FROM gallery_albums WHERE draft = 0 ORDER BY gallery_id DESC
LIMIT 0,3") 
or die(mysql_error()); 
    while($album1 = mysql_fetch_array( $album )) {


if ($album1['department_id'] == '1'); {
$albumURL = "http://ufire.sabinalcanyon.org/gallery.php?gallery_id=".$album1['gallery_id'];
}
if ($album1['department_id'] == '2'); {
$albumURL = "http://ems.sabinalcanyon.org/gallery.php?gallery_id=".$album1['gallery_id'];
}
if ($album1['department_id'] == '3'); {
$albumURL = "http://vfire.sabinalcanyon.org/gallery.php?gallery_id=".$album1['gallery_id'];
}   

echo "
<li class=\"clearfix\">
<a href=\"".$albumURL."\" class=\"thumbnail\">
<img src=\"".$album1['poster_image']."\" width=\"50\" height=\"50\" alt=\"\" />
</a>
<a href=\"".$albumURL."\" class=\"entry-title\">".$album1['title']."</a>
<div class=\"entry-excerpt\">".$album1['desc']."</div>
</li>";
}
?>
4

1 回答 1

1

你知道当你应该有2个时你有一个'='进行比较?

于 2013-07-15T18:46:25.690 回答