It is not feasible to determine if there is any bad practice in the displayed code.
The question is vague and creates a disconnected sense.
Something closer to "bad practice" may be the style used in PHP syntax.
ex:
foreach($dadosbanco as $value):
endforeach
could be
foreach ($dadosbanco as $value) {
}
I believe this style is more readable. I'd rather avoid alternative ways. Because it just makes code more complex, especially for beginners in language. But it is personal opinion and can ignore. Just can not ignore that there are standards defined and accepted by the PHP community in the whole world. Currently there is an effort to spread the "PSRs". See official website: link
Just do not confuse this as if it were a law, as no one is obliged to use the standards suggested by this site, nor should we judge the style and patterns of other codes compared to the "PSRs."
Another point is to invoke echo
in a loop of repetition. It is usually slower than concatenating and giving only a echo
. But that is neither very relevant nor considered bad practice.
Something that I imagine may come close to the purpose of the question is that you may have heard something about avoiding mixing HTML, PHP, etc. code. The one from MVC.
Still, as presented, there is no relevant bad practice.