In my csv file ("food.csv") the data is stored in the order -ITEM, DESC, QTY, RATE, TYPE. When I use an array to find the element code, all the results are displayed on one page. What I need is a result that should be limited to 5 cases per page along with "NEXT / BACK". Can anyone help me out? other wise men offer any other option, please. The PHP file is shown below.
<?php
$handle = fopen("food.csv","r")or die("file dont exist");
$output = ' ';
while (!feof($handle )){
$data = fgetcsv($handle, 4096, ",");
if($data[0] ==100){
$output .= sprintf( "<b>Fruit Name: %s. </b><br>", $data[1]);
$output .= sprintf( "Quantity Avaliable: %d Kgs @ %d USD each. <br>", $data[2], $data[3]);
$output .= sprintf( "Item code: %d (Stock: %s) <br><hr><br>", $data[4],$dara[0]);
}
}
echo $output;
fclose($handle);
?>
All results are approximated (12 cases) on one page, for example:
Fruit name: MANGO Available quantity: 10 kg for 500 US dollars each. Product Code: 100 (Stock: OLD)
Fruit Name: APPALE Amount Available: 12 Kgs @ 300 USD Each. Product Code: 100 (Stock: NEW)
: MANGO : 5 Kgs @650 USD . : 100 (Stock: NEW)