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) { ?>
$i++; as u can see i wish by click the next button it will come out the next record… |