Ma taki oto skrypt newsowywyswietlajacy 10 najnowszych newsow:
$ncnt=mysql_fetch_array(sql("select max(id) from news;"));
$max=$ncnt[0];
for($i=1;$i<=10;$i++)
{
$topic=mysql_fetch_array(sql("select $g1 from news where id = $max"));
$msg=mysql_fetch_array(sql("select $g2 from news where id = $max"));
$aut=mysql_fetch_array(sql("select aut from news where id = $max"));
$tdate=mysql_fetch_array(sql("select dat from news where id = $max"));
if($topic[0]!="")
{
echo(iso("<span class="topic">$topic[0]</span><br>"));
echo(iso("<span class="text2">$tdate[0]</span><br><br>"));
echo(iso("<span class="text2">$msg[0]</span><br>"));
echo(iso("<p class="sign">$aut[0]</p>"));
}
$max--;
}
Funkcje sql zdefiniowalem,
wszystko jest OK tylko ze mam problem ze zmienna $msg
Otoz kiedy robie echo($msg); to wyswietla mi sie "Array" - prawidlowo,
ale kiedy mam $msg[0] to nie widze nic... W czym problem, moze text do pobrania z bazy jest za dlugi?