I believe I got it working, thanks to your guys’ help! I’ve posted it, just in case anyone sees an error or if any other users need to use something similar:
Query:
mysql_select_db($database_rcofcuser, $rcofcuser);
$query_getCat = "SELECT DISTINCT UPPER(LEFT(member_directory.name,1)) as letters FROM member_directory ORDER BY letters";
$getCat = mysql_query($query_getCat, $rcofcuser) or die(mysql_error());
$row_getCat = mysql_fetch_assoc($getCat);
$totalRows_getCat = mysql_num_rows($getCat);
PHP:
<?php echo '<a style="text-decoration: none;" href="member_directory_alpha.php?ltr='.$row_getCat['letters'].'">'.$row_getCat['letters'].'</a>'; ?>
members_directory_alpha.php
Query:
$var1_getCat = "-1";
if (isset($_GET['ltr'])) {
$var1_getCat = $_GET['ltr'];
}
mysql_select_db($database_rcofcuser, $rcofcuser);
$query_getCat = sprintf("SELECT member_directory.name, member_directory.contact, member_directory.`position`, member_directory.address, member_directory.city, member_directory.`state`, member_directory.zipcode, member_directory.voice, member_directory.fax, member_directory.email, member_directory.url_address, member_directory.heading_id FROM member_directory WHERE UPPER(LEFT(member_directory.name,1)) = %s", GetSQLValueString($var1_getCat, "text"));
$getCat = mysql_query($query_getCat, $rcofcuser) or die(mysql_error());
$row_getCat = mysql_fetch_assoc($getCat);
$totalRows_getCat = mysql_num_rows($getCat);
PHP:
<?php if (!empty($row_getCat['name'])) { echo '<strong>' . $row_getCat['name'] . '</strong><br />' ; } ?>
<?php if (!empty($row_getCat['contact']) && (!empty($row_getCat['position']))) { echo $row_getCat['contact'] . ', ' . $row_getCat['position'] . '<br />' ; } ?>
<?php if (!empty($row_getCat['address'])) { echo $row_getCat['address'] . '<br />' ; } ?>
<?php if (!empty($row_getCat['city'])) { echo $row_getCat['city']; } ?>
<?php if (!empty($row_getCat['state'])) { echo ', ' . $row_getCat['state']; } ?>
<?php if (!empty($row_getCat['zipcode'])) { echo ' ' . $row_getCat['zipcode'] . '<br />' ; } ?>
<?php if (!empty($row_getCat['voice'])) { echo '<strong>Phone: </strong>' . $row_getCat['voice'] . '<br />' ; } ?>
<?php if (!empty($row_getCat['fax'])) { echo '<strong>Fax: </strong>' . $row_getCat['fax'] . '<br />' ; } ?>
<?php if (!empty($row_getCat['email'])) { echo '<strong>Email: </strong>' . urls2linkscomplex($row_getCat['email']) . '<br />' ; } ?>
<?php if (!empty($row_getCat['url_address'])) { echo '<strong>Web: </strong>' . '<a href="http://' . $row_getCat['url_address'] . '" target="_blank">'; echo $row_getCat['url_address']; } if (!empty($row_getCat['url_address'])) { echo '</a>'; } ?>
The results seems to be coming out as expected!
Thanks again Sitepoint!