Ben bir mysql bir kategori kimliği atanmış sonuçlar tablo ve kendi kimliği ile 'adıyla kategorilerin tümünü listeler ayrı bir tablo var. Tüm sonuçları kendi id tarafından gruplandırılmış ve kimliği başlığı olarak görüntülenir.
How do I display the id as its respective name from the other database? Here is the full code I'm using, with the line in question commented out. Any help greatly appreciated. S.
$subcatQuery=mysql_query("select * from issubcat order by id");
$subcatResult=mysql_fetch_array($subcatQuery);
$query = "SELECT * from isgallery where galleryPage ='1'";
$resultSet = mysql_query($query);
if (mysql_num_rows($resultSet))
{
$gallArray = array();
while ($galleryResult = mysql_fetch_array($resultSet))
{
// if($galleryResult['subcatPage'] == $subcatResult['id'])
// {
// $gallSection = $subcatResult['subcat'];
// }
if (!isset($gallArray[$gallSection]))
{
$gallArray[$gallSection] = array();
}
$gallArray[$gallSection][] = $galleryResult;
}
foreach($gallArray as $gallSection => $gallItems)
{
echo '<div class="com-gallery">' . $gallSection . '</div>' . PHP_EOL;
echo '<ul class="photo-gallery">'. PHP_EOL;
foreach ($gallItems as $photoresult)
{
echo '<li><a rel="gallery" href="'.$wwwUrl.'images/properties/gallery/'.$photoresult['imagename'].'" ';
if($photoresult['galleryTitle'])
{
echo 'title="'.$photoresult['galleryTitle'].'"';
}
else
{
echo 'title="'.$photoresult['imagename'].'"';
}
echo '><img alt="" src="'.$wwwUrl.'images/properties/gallery/tn/'.$photoresult['imagename'].'" width="122" height="88" /></a></li>'. PHP_EOL;
}
echo '</ul><br /><br />' . PHP_EOL;
}
}
}