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

  • Home
  • SEARCH
  • 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 6197457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:49:28+00:00 2026-05-24T03:49:28+00:00

just to know if someone have any idea why this bug is happening. I

  • 0

just to know if someone have any idea why this bug is happening.

I have the following code

<?php 
foreach($productArray as $key=>$value)
{
    if ($key == 'cod_prod')
    {
?>
      <td>

}
}
?>

I didnt finished the rest of the code because its working fine, except by this part.

In the example above if I put the var_dump($codeList) in the first position it prints out the results of the array just fine, if i place the var_dump($codeList) in the second position it comes back empty. If i put both the var_dumps in both positions the same thing happens

To check this im using var_dump($codeList), took out the options and everything else and the array simply come back EMPTY if I insert the select markup

Any ideas?

UPDATE

The $codeList is being generated at a controller, in this case, here

    $this->setVar(array(
        'DataAtual' => $Solicitacao->DataAtual,
        'ClienteEmail' => $Solicitacao->clientEmail,
        'ClienteNome' => $Solicitacao->userName,
        'ClienteTelefone' => $Solicitacao->userTelefone,
        'VendedorNome' => $Solicitacao->VendedorNome,
        'VendedorEmail' => $Solicitacao->VendedorEmail,
        'VendedorTelefone' => $Solicitacao->VendedorTelefone,
        'PagamentoForma' => $Solicitacao->PagamentoForma,
        'PagamentoPrazo' => $Solicitacao->PagamentoPrazo,
        'PagamentoFrete' => $Solicitacao->PagamentoFrete,
        'Produtos' => $Solicitacao->ProdutosArr,
        'Observacoes' => $Solicitacao->ObservacoesArr,
        'MensagemEmail' => $Solicitacao->MensagemEmail,
        'PageTitle' => $Solicitacao->PageTitle,
        'Action' => $Solicitacao->Acao,
        'PageType' => $Solicitacao->PageType,
        'vendorInfo' => $Solicitacao->vendorInfo,
        **'codeList' => $Solicitacao->codeList,**
        'moneyFields' => $Solicitacao->moneyFields,
        'coresArr' => $Solicitacao->coresArr
        ));

The $Solicitacao->codeList is being generated in the Model, here (just a simple array made by wordpress)

 $getCodesListSQL = "SELECT cod_prod FROM wp_products ORDER BY cod_prod ASC;";
        $this->codeList = $wpdb->get_results($getCodesListSQL);

RESUME

A FULL array Gets dumped

 var_dump($codeList);
    echo '<select>';
    //var_dump($codeList);

A EMPTY array Gets dumped

 //var_dump($codeList);
    echo '<select>';
    var_dump($codeList);
  • 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-05-24T03:49:30+00:00Added an answer on May 24, 2026 at 3:49 am

    The output is not visible because it is in a SELECT element. SELECT only accepts OPTION elements as children. Do a View Source on the generated HTML and see that the values are actually there, just that browsers don’t know what to do with them.

    It depends on the browser but: when you view the generated HTML , if it is shown in a view where you can collapse nodes then it gets the HTML by calling innerHTML function on the shown element. If the inner HTML is not valid then it shows nothing.

    The content is there but the browser chooses to ignore and remove it in the view you are using to view the generated HTML.

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

Sidebar

Related Questions

I have posted this question on the Ext-GWT forums, I am just hoping that
I am hoping that someone may have an idea on how to control/specify the
I just wonder, if all compilers in any language transform the code into the
Essentially I'd like to know just how compatible are the iPhone and the iPod
Just wanted to know how i would replace sitename.com with sitename2.com whenever a user
Just wanted to know. Is it possible to highlight text in ElasticSearch on an
Just wanted to know something about signed vs unsigned interpretation. Am I right if
Just want to know if publishing an application on Google play is allowed using
Just wanted to know if anyone is really using Objects and Collections in Oracle
Just want to know how to read an attribute of a parent node from

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.