Hi,
I am writing a page and i am having some trouble with some variable stuff. I have a block of PHP code connecting to a dbserver and performing a query, and some blocks of regular HTML, a block of PHP, HTML...you got the idea. The first PHP code also fetches the results of the Dbquery. The problem is that i am having trouble printing the rest of the variables on the other blocks. I've tried assigning variables to the whole vector that resulted from the query, and printing this variables, but no luck.
Here's a sample of the code :
<?php while ($bandas=mysql_fetch_array($query)) {
print "$bandas[nome]" ; } / works ok and prints / ?>
HTML BLOCK
<?php
print "$bandas[estado]" ; ?>
HTML BLOCK....
Also tried :
<?php while ($bandas=mysql_fetch_array($query)) {
print "$bandas[nome]" ; }
$estado="$bandas[estado]"; ?>
HTML BLOCK
<?php
print "$estado" ; ?>
Also tried global variables with no luck. Any tips?
Thanks,
Ivan