What's best, close before or after while?
For example, Mode1 :
$sql= "SELECT * FROM tabela";
$rs = mysql_query($sql,$connect);
mysql_close($connect);
while($row = mysql_fetch_array($rs)){
$nome = $row['nome'];
echo $nome;
}
or Mode2:
$sql= "SELECT * FROM tabela";
$rs = mysql_query($sql,$connect);
while($row = mysql_fetch_array($rs)){
$nome = $row['nome'];
echo $nome;
}
mysql_close($connect);
- The close before or after the while? Mode1 or Mode2?