我已经阅读了几篇堆栈溢出后,并编写了这个小程序。但是,不是一次读取一条记录,而是读取同一条记录……我哪里错了?
// ...................................... NUMBER OF RECORD
$result = mysqli_query($data->connessione,"SELECT COUNT(id) FROM tsynapse") ;
if ( $result == false ) { printf ("<br/> mysqli : Error Reading FROM tsynapse; <br/>"); break ; }
echo "<br/> record totali <br/>" ;
$row = mysqli_fetch_array($result) ;
echo $row[0] . "<br/>";
// ...................................... COUNTER
$k=$row[0] ;
while ( $k-- )
{
// ...................................... READ ONE RECORD AT TIME
$result = mysqli_query($data->connessione,"SELECT * FROM tsynapse LIMIT 1") ;
if ( $result == false ) { printf ("<br/> mysqli : Error Reading FROM tsynapse; <br/>"); break ; }
$row = mysqli_fetch_array($result);
echo $row['id'] . " XXX " . $row['tag'] . " XXX " . $row['token'] . " XXX " . $row['rule']. " XXX " . $row['trans'] ;
echo "<br>";
}