zirgs Posted June 11, 2006 Report Share Posted June 11, 2006 Nu man ir shads skripts: <?php include 'db_con.php'; $numb = $_GET['numb']; settype($numb,"integer"); if(!empty($_GET['numb'])) { $sql = mysql_query("select * from news where id = '$numb'"); $num = mysql_num_rows($sql); $sql_k = mysql_query("select * from komentari where zinjuid = '$numb' order by id desc"); if($num == 1) { $row = mysql_fetch_array($sql); $row_k = mysql_fetch_array($sql_k); $t = $row["t"]; $d = $row["d"]; $n = $row["n"]; $iz = $row["iz"]; $au = $row_k["au"]; $co = $row_k["co"]; $cod = $row_k["cod"]; echo "<span id=virs>"; echo $t; echo "</span><br />"; echo "<span id=dat>"; echo $d; echo "</span><br />"; echo $n; echo "<br /><br /><br /><br /><br />"; echo "<span id=au>"; echo $au; echo "</span><br />"; echo "<span id=dat>"; echo $cod; echo "</span><br />"; echo $co; echo "<br /><br />"; } } if(empty($_GET['numb']) OR $num <> 1) { $sql = mysql_query("select * from zinjas order by id desc"); while($row = mysql_fetch_array($sql)) { echo "<span id=virs><a href=zinjas.php?numb="; echo $row["id"]; echo ">"; echo $row["t"]; echo "</a></span><br />"; echo "<span id=dat>"; echo $row["d"]; echo "</span><br />"; echo $row["iz"]; echo "<br /><br />"; echo "<div class=komentari>"; echo "<a href=zinjas.php>Komentari</a>"; echo "</div>"; } } ?> un itka kad nesaku likt klat komentarus tad viss gaaja kaa pa sviestu ... bet tagad attiec zinjas komentaros rada tkai 1 komentaru(kaut datubaze ir vairaki,attiec. pedejo vai pirmo ka ir uzlikts order by) ... kursh zin ? izmegjinaju visadi ... paldies! Link to comment Share on other sites More sharing options...
KAC Posted June 11, 2006 Report Share Posted June 11, 2006 slikti meegjinaaji (lol) Link to comment Share on other sites More sharing options...
zirgs Posted June 11, 2006 Author Report Share Posted June 11, 2006 skaidrs ... no tevis neko normalu nevar gaidit ... Link to comment Share on other sites More sharing options...
v3rb0 Posted June 11, 2006 Report Share Posted June 11, 2006 izskatās ka zirgs tik māk tik bļaut uz citiem, bet izlasīt ko pats sarakstījis nemāk. tur tak nav neviens cikls cauri komentāriem, kā gan vairāk par vienu komentāru rādīsies? Link to comment Share on other sites More sharing options...
zirgs Posted June 11, 2006 Author Report Share Posted June 11, 2006 skaidrs ... nu ja neko noderigu nemak uzrakstit (KAC) tad kapec radit savu "krutumu"! skaidrs v3rb0 paldies tev ka pateici atskj. no dazhiem labiem ... Link to comment Share on other sites More sharing options...
KAC Posted June 11, 2006 Report Share Posted June 11, 2006 esmu nezheeliigi kruts! Link to comment Share on other sites More sharing options...
Recommended Posts