niente, non riesco a capire la logica del tutto e non riesco a farlo...
provo a postare il codice:
Codice PHP:
$query = mysql_query("SELECT * FROM blogs, bloggati WHERE blogs.id_bloggato='$id_b'
AND bloggati.id_bloggato=blogs.id_bloggato ORDER BY num_voti DESC, media DESC") or die(mysql_error());
if(mysql_num_rows($query) <=0){
$q2 = mysql_query("SELECT * FROM bloggati WHERE id_bloggato='$id_b'") or die(mysql_error());
$row = mysql_fetch_array($q2);
echo"<h1>|| Blog per $row[nome] $row[cognome] ||</h1>";
echo"<table width=100% style='font-size: 10pt'>
<tr><td width=30%><img src='http://lsdblogs.altervista.org/img/foto/$row[foto]'></td>
<td align=left width=70%><form name=blogga id=blogga method=post action=./script/Sblog.php?id_b=$id_b>
<fieldset class='blog'>
<legend>|| Invia Blog...</legend>
<table style='font-size: 10pt'>
<tr><td><img src='http://lsdblogs.altervista.org/img/bullet.jpg'> Mittente:</td><td><input type=text name=mittente size=17></td></tr>
<tr><td valign=top><img src='http://lsdblogs.altervista.org/img/bullet.jpg'> Blog:</td><td><textarea name=frase cols=15></textarea></td></tr>
<tr><td> </td><td align=right><input type=submit name=submit value='|| Blogga'></td></tr>
</table>
</fieldset>
</form></td></tr></table><br>";
}
while($row = mysql_fetch_array($query)){
$comm = mysql_query("SELECT id_blog, COUNT(*) as num_commenti FROM commenti GROUP BY id_blog");
$riga = mysql_fetch_array($comm);
echo"<table style='font-size: 10pt'><tr><td valign=top><font size='-1'><b>$i.</b></font></td><td valign=top>".nl2br($row['frase'])."</td><td></td></tr></table>
<table align=center style='font-size: 8pt; color: #666666' width='100%'><tr><td width='30%' align=center>|| Media voti:<b> $row[media] </b></td><td align=center width='30%'><form method=post action='./script/vota.php?id_b=$row[id_blog]'>|| Vota:
<select name=voto size=1 onChange='submit()'>
<option selected></option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></form> </td><td width='30%'><form name='comm".$i."' id='comm".$i."' method=post action='commenti.php?id_c=$row[id_blog]&id_b=$id_b'>|| <a href='#' onClick=\"invia('comm','$i')\" title='Consente di commentare questa frase'>Commenti </a>($riga[num_commenti])
<input type=hidden name=testo value='$row[frase]'></form></td></tr></table>
<p align=right><font size='-2' color=#666666>$row[data] Mittente: $row[mittente]</font></p><br><hr width=80%><br><br>";
$i++;
}
continuo ad avere bisogno di aiuto :(
mi spaete consigliare qualcosa?
non riesco a conteggiare le cose :(