Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
eai pessoal.. eu tenho uma array $select_news
com o print_r eu tenho isso aqui de retorno
Array (
[0] => 1
[id_noticia] => 1
[1] => Primeira Noticia [titulo_noticia] => Primeira Noticia
[2] => Raphael Godoi [autor_noticia] => Raphael Godoi
[3] => primeira [texto_noticia] => primeira
[4] => images/1.jpg [foto_noticia] => images/1.jpg
)
Array (
[0] => 2
[id_noticia] => 2
[1] => Segunda Noticia [titulo_noticia] => Segunda Noticia
[2] => Raphael Godoi [autor_noticia] => Raphael Godoi
[3] => segunda [texto_noticia] => segunda
[4] => images/1.jpg [foto_noticia] => images/1.jpg
)eu faço essa array com o seguinte codigo
function select($string){ //selecionando e retornando uma array
$qry = mysql_query($string) or die(mysql_error());
$out = array();
while($k = mysql_fetch_array($qry)){
$out = $k;
}
return $out;
}
testa ai... abraço!!