Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Mysql und PHP problem
Anarion
post
Post #1





Grupa: Zarejestrowani
Postów: 88
Pomógł: 0
Dołączył: 22.04.2002

Ostrzeżenie: (0%)
-----


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?


--------------------
If You don't believe in Yourself, no one else will.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 19:18