next + prev button

hai there,
currently i new in php. i hope u guy can suggestion n give me some idea how to make my next button working.

here example i have done by using loop if i make it wrong please correct me.

<? php ........ .... $org = new ORG_Details(); if(isset($_POST['a_no'])) $item_id = $_POST['a_no']; elseif(isset($_GET['a_no'])) $item_id = $_GET['a_no']; else{ $sql = mysql_query("SELECT id FROM tblname WHERE CUTOPEN='0'");//MAT_CUTOPEN=0 means still not available $row = mysql_num_rows($sql); $get = mysql_fetch_object($sql); if($row>0) $item_id = $get->MAT_ID_AC;//if no ID selected, display 1st record as default else $item_id = NULL; } $item = new MAT_Detail ($item_id); $mat_id = ($item->row>0)?$item->id:NULL; $mat_id_acc = ($item->row>0)?$item->mat_id_ac:NULL; $LCCN = ($item->row>0)?$item->mat_id_lc:NULL; if($item->row>0){ if($cutopen=='0'){ $color = 'error'; $msg = ERROR_113; }else{ $color = 'noerror'; $msg = ERROR_112; } }else{ $color = 'error'; $msg = "(*".ERROR_110.")"; } $sql = mysql_query('SELECT COUNT(*) AS total_record FROM tblname') or die(mysql_error()); $row = mysql_fetch_assoc($sql); $total_record = $row['total_record']; echo $total_record; $i=1; while ($i <=$total_record) { ?>

' method='post' name='frmfinditem' onSubmit=''> ' method='post' name='formml' onSubmit='validate();return false;'>
	</TABLE>
	</fieldset>
</TD>
field num Query
Master File Number    " readonly >
Control Number 000 <?php //echo $pager->renderPrev().$pager->renderNext(); ?> Key in Control/Accession Number & press 'Enter'   <?php echo $msg; ?>
Number 010
<?php echo "PREV "; echo "NEXT

"; ?>

  
 
<?php

$i++;
}

as u can see i wish by click the next button it will come out the next record…
i still don’t how to make this loop go to next record by using next button… :-\ ???

I assume you figured this out since it’s working on your website?

almost.

i also try this thing by using php paging, but it doesn’t show the next records as i wish it.

do u have any suggestion??

Sponsor our Newsletter | Privacy Policy | Terms of Service