lilywong Posted February 27, 2006 Share Posted February 27, 2006 How to get the next record for each time the icon is pressed ?the database like 100015501551155215531554155515561557155815591560for example, the first record showed is 1000, when i press the icon, it should only show 1000, when i press the icon second time, it shold only display 1550, the third time i pressed it should only show 1551. (ie. click one time, and the running number will increase one )however my code will show all the records from the first until the end, what's the problem ?below is the codes.===================================================================$sql = "SELECT * FROM record";$rs = $db->Execute($sql); $record = $rs->fields[RecordNo]; $total = $rs->RecordCount(); $i = 0;?><form method='post' action='index.php'><table width='200' border=1><tr><td width='100'>Current Number</td> <td width='100'><?=$record?></td><tr><tr> <td colspan='2' align='right'> <a href='index.php?generate=generate'><img src='images/mouse.gif' border='0' title='GENERATE'></a></td></tr></table></form><?if ($_GET[generate]==generate){ while (!$rs->EOF) { $record = $rs->fields[RecordNo]; print $record; echo "<br>"; $rs->MoveNext(); } }?> Link to comment https://forums.phpfreaks.com/topic/3660-get-next-record/ Share on other sites More sharing options...
jvrothjr Posted June 3, 2008 Share Posted June 3, 2008 use the limit function of the query. Link to comment https://forums.phpfreaks.com/topic/3660-get-next-record/#findComment-556189 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.