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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:03:08+00:00 2026-06-06T02:03:08+00:00

I am calling the query function from cakephp, and I am selecting two fields

  • 0

I am calling the query function from cakephp, and I am selecting two fields from the database. How do I access each field from the array? The query is as such

$fieldKeys = $this->query("select FLOWSHEET_NAME, FLOWSHEET_ID from FLOWSHEET_TEMPLATE");

And I want to do something along the lines of:

foreach($fieldKeys as $value){
        foreach($value as $nest){
            foreach($nest as $id){
                $mapArray[$id[0]] = $id[1];
            }
        }
    }

But this doesn’t work.
This works but $id[0] only gives back the first letter of the string held in the FLOWSHEET_NAME column, whereas I want the whole string.

  • 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-06T02:03:09+00:00Added an answer on June 6, 2026 at 2:03 am

    Cake gives you tools to inspect the array and see for yourself. These tools are pr($varname) and debug($varname), but there are other non-cake functions as well.

    This is not really a cake question, it’s an elementary programming class question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into an issue calling a User Defined Function from a LINQ query.
I'm selecting records from a database using the equivalent of this query: SELECT *
I am calling a function twice from two different functions, But for one of
Suppose I am calling a query SELECT name, city, country FROM People. Once I
This is the function that im calling. function GetSubmissions($coach){ $result = mysql_query(SELECT * FROM
I am calling data from a database and I would like to put an
I am trying to reference an array through a function I am calling $bio['results']
when calling the following function I get an error. The HQL query functions downloading
the signature of the query-replace function in emacs looks like this : (query-replace FROM-STRING
Ok, here is a real short query. I am calling __FILE__ from inside a

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.