PDA

View Full Version : [php] mysql_fetch_row


$te
26-04-2008, 12:09
devo contare le righe da una tabella:

while ($row = mysql_fetch_row($report))
{
$a ++;
}

ma poi devo stamparle, solo che dovrei "ricaricare" il tutto, come posso fare?

infatti se poi faccio
while ($row = mysql_fetch_row($report)) {


echo'<td>
<b>Link:</b>
<a href="'.$row[1].'" target="_blank">
'.$row[2].'
</a>
</td>';
}

non cé nessun dato

grazie

vizzz
26-04-2008, 12:54
http://it2.php.net/manual/it/function.mysql-num-rows.php

$te
26-04-2008, 17:52
giusto cosi quindi?

$a = mysql_affected_rows($report);

perché non funziona

vizzz
27-04-2008, 08:37
giusto cosi quindi?

$a = mysql_affected_rows($report);

perché non funziona

incolla qui tutto il codice

$te
27-04-2008, 23:23
$a = mysql_affected_rows($report);

$b = 0;

while ($row = mysql_fetch_row($report)) {

if($a > 5)
{
$b++;

if($b > 1) $b = 0;
}

if($b == 0) echo'<tr>';

echo'<td>
<b>Link:</b>
<a href="'.$row[1].'" target="_blank">
'.$row[2].'
</a>
</td>';

$id = mysql_query("
SELECT id
FROM $name
");
echo' <td>
<form action="include/delete.php" method="post">
<input type="submit" value="delete">
<input type="hidden" name="id" value='.$id.'>
</form>';
echo 'bravo'.$id.'ecco';
echo'

</td>';
if($b == 0) echo'</tr>';
echo'<br /><br />';

};
echo' </table>' ;

kk3z
28-04-2008, 09:43
mysql_num_rows, non mysql_affected_rows, visto che stai facendo una SELECT