Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8487989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:24:21+00:00 2026-06-10T21:24:21+00:00

thanks in advance for the help with this. My problem is this, i have

  • 0

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:

postmaster@john-stapleton.com
john@john-stapleton.com

when it is supposed to say this:

info@john-stapleton.com
postmaster@john-stapleton.com
john@john-stapleton.com

any idea what i am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:24:22+00:00Added an answer on June 10, 2026 at 9:24 pm

    You’re doing the first fetch immediately after defining the query

    $domain_boxes_results = mysql_fetch_array($domain_boxes_query, MYSQL_ASSOC); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thanks in advance for any help you can provide on this issue! I manage
First off, thanks in advance for your help. This issue is driving me nuts.
Thanks for any help in advance, I can't wrap my SQL skills around this
newbie here, so thanks in advance for help! I have a Wordpress site with
Thanks in advance for your help. I have a need within an application to
I am using c# .net. Thanks in advance for any help. I have searched
I have this problem, my code doesn't work when i try to find eyes
Hi I have problem in code that the following code retuning the error that
i have a problem with Dictionary, hope you'll help me. I have the following
I used rails3.2.3 with mongoid gem for mongodb database. I have following code user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.