Count counting it wrong?

Asked

Viewed 72 times

-2

I have the following call to a function:

$exitente = $membrosDao->pesquisaMembrosNasFuncoes( $_POST[ "idMembro" ] );

That for the requests below

print "<pre>";
print count($existente)."<br />";
print_r($exitente);
print "</pre>";

Give me the following result :

0
Array
(
    [0] => Array
        (
            [idMembro] => 2
            [nomeTabela] => pastores
        )

)

Where am I missing? If the array has 1 return because the count is returning 0?

1 answer

7


Count is returning zero because the variable name is wrong.

Note on the first call:

$exitente = $membrosDao->pesquisaMembrosNasFuncoes( $_POST[ "idMembro" ] );

The variable name is $exitente

And right after you print $existente

As the variable $existente has no value, returns 0.

  • thanks. Lack of attention.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.