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 7745961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:09:19+00:00 2026-06-01T10:09:19+00:00

I am building an app with complex data which I use arrays for. Some

  • 0

I am building an app with complex data which I use arrays for. Some of the data comes direct from fetchs from a postgresql data base and some comes from calculation and processing.

I initally build the array that holds all this and everything goes along fine.

Later during processing I have the following code. This is one section of my code.

    foreach ($this -> detailTables as $key => $detTable) {
        foreach ($detTable['columns'] as $key2 => $column) {
            if ($column['isID'] == 't') {
                $detTable['mainid'] = $column['columnName'];
            }
            if ($column['lookupTable'] != '') {
                $select = array('table' => $column['lookupTable'], 'id' => $column['lookupID'], 'disp' => $column['lookupDisplay']);
                $detTable['lookups'][] = $select;
            }
        }
        logw($key . ' mainid 1', $detTable['mainid']);
        logw($key.' lookups 1', $detTable['lookups']);
    }

    foreach ($this -> detailTables as $key => $detTable) {
        logw($key . ' mainid 2', $detTable['mainid']);
        logw($key.' lookups 2', $detTable['lookups']);
    }

Basically I am scanning detailTables for and their columns to determine and set values for mindid and the lookups array

In the second foreach segment I am just logging the values to see if the persist.

My Log file reads as follows.

columns mainid 1 = columnID
array columns lookups 1
 array 0
  table = tables
  id = tableID
  disp = tableName

tabs mainid 1 = tabID
array tabs lookups 1
 array 0
  table = tables
  id = tableID
  disp = tableName

and the output from the second part reads

columns mainid 2

columns lookups 2

tabs mainid 2

tabs lookups 2

I cannot figure out why the two log sections are not identical.

  • 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-01T10:09:21+00:00Added an answer on June 1, 2026 at 10:09 am

    From my understanding of you structure you need to reset the iteration after the first for each through

        }
        logw($key . ' mainid 1', $detTable['mainid']);
        logw($key.' lookups 1', $detTable['lookups']);
    }
    //reset variables here
    foreach ($this -> detailTables as $key => $detTable) {
        logw($key . ' mainid 2', $detTable['mainid']);
        logw($key.' lookups 2', $detTable['lookups']);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an iOS App which displays video streams from a somewhat complex
I'm building an app that pulls data in from an excel .csv file and
I'm building app using GAE and wanted to use Django for that. Which patch
I'm building an app that authors would (hopefully) use to help them, uh.. author
I'm building an app in PHP and I'm using the data mapper pattern for
I'm currently building an Excel 2003 app that requires a horribly complex form and
I'm building app in django which I want to deploy on aws ec2 server.
Im building an app with a tab-layout. And i have some concerns about tab-layout
I'm currently exploring the different options for building a not-too-complex web application, in which
I'm part way through building a fairly complex HTML5 web app, that retrieves its

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.