thanks in advance for the help with this.
My problem is this, i have the following code (minus the database connect info and the table names are changed for security). i am stuck here so this is not the finished product. i am building an admin script for my mail server that does virtual domains, users, and aliases drawn froma database. this server works flawlessly. i call this function on my domain detail page to list first the number of mail boxes and then the number of aliases which then lets you go in and edit, add and deleted them. i get all the way to listing the mail box names and it seems to skip the first record. my function is as follows:
function listdomaindetails() {
$domain = $_GET['domain'];
$domaindetails_query = mysql_query("SELECT id FROM virtual_domains WHERE name='$domain'"); //get domain id
$domaindetails_results = mysql_fetch_array($domaindetails_query, MYSQL_ASSOC); //Set domain id
$domain_boxes_query = mysql_query("SELECT email FROM virtual_users WHERE domain_id='$domaindetails_results[id]'"); //Get virtual users
$domain_boxes_results = mysql_fetch_array($domain_boxes_query, MYSQL_ASSOC); //Set virtual users
$domain_boxes_count = mysql_num_rows($domain_boxes_results); //Count Boxes
$domain_aliases_query = mysql_query("SELECT 'source', 'destination' FROM virtual_aliases WHERE domain_id='$domaindetails_results[id]'"); //Get aliases
$domain_aliases_results = mysql_fetch_array($domain_aliases_query, MYSQL_ASSOC); //Set aliases
$domain_aliases_count = mysql_num_rows($domain_aliases_results); //Count Aliases
if ($domain_boxes_count = 0) {
echo "This domain has no Email boxes, please add some by clicking <a href='email_add.php?domain=$domain'>HERE</a>";
} else {
while ($domain_boxes_row = mysql_fetch_array($domain_boxes_query, MYSQL_ASSOC)) {
echo "<a href='email_detail.php?box=".$domain_boxes_row['email']."&domain=".$domain."'>".$domain_boxes_row['email']."</a><br>";
}
}
}
the page shows the following:
[email protected]
[email protected]
when it is supposed to say this:
[email protected]
[email protected]
[email protected]
any idea what i am doing wrong?