1
Hello, I would like a help with the command below. I am trying a read in a database table but I cannot do the while
, because it only shows the last record.
Note: Using the vardump
she shows the loop
normal.
<?
class AppNoticiasDestaque{
function AppNoticiasDestaque() {
$verQ = "SELECT * FROM noticias";
$ver = mysql_query($verQ) or die(mysql_error());
if(mysql_num_rows($ver) > 0) {
while($verRow = mysql_fetch_array($ver)) {
var_dump ($this->AppNoticiasDestaque = $verRow);
}}
@mysql_free_result($ver);
}
}
?>
//resgatando o resultado
<?=$obj->AppNoticiasDestaque['titulo_noticia'] ?>
If possible, use mysql_fetch_assoc as it is faster than mysql_fetch_array
– LucaoA
Okay, thank you very much. Changed to mysql_fetch_assoc. ;)
– user36373