here, maybe it'll help if I give you the entire code:
here's the viewitems.php file, this is the one where it lists the items in the database:
<form action=admin.php method=post>
<input type=hidden name=view value=invoice>
<?
include("paging.class.php");
//init the class
$paging = new PagedResults();
//tell it how many results to page through
$sql = "SELECT COUNT(*) AS Total FROM db1";
$query = mysql_query($sql);
$data = mysql_fetch_array($query);
$paging->TotalResults = $data["Total"];
//now you need to run the query again but this time with limit1 and limit2
$InfoArray = $paging->InfoArray();
$sql = "SELECT * FROM db1 LIMIT ".$InfoArray["MYSQL_LIMIT1"].", ".$InfoArray["MYSQL_LIMIT2"];
$query = mysql_query($sql);
echo "<table cellspacing=3 cellpadding=3 border=0>";
echo "<tr><td></td><td><b>Buyer</td><td><b>Con#</td><td><b>Order#</td><td><b>DSN#</td><td><b>Quality</td><td><b>Deliv.Date</td><td><b>Price</td><td><b>Width</td><td><b>Book Qty</td><td><b>Term</td><td><b>Destination</td><td><b>Trade Terms</td><td><b>Ship Date</td><td><b>Ship Qty</td><td><b>R/Payment</td><td><b>Supplier</td><td><b>Factory Cost</td><td><b>RMK Cancel After Verification</td><td><b>Invoice</td><td><b>Packing List</td><td><b>Edit</td><td><b>Delete</td></tr>";
while($data = mysql_fetch_array($query)) {
//heres where you get to print our your data from your query
echo "<tr><td><input type=checkbox name=cb[]></td></td><td>$data[buyer]</td><td>$data[connum]</td><td>$data[ordernum]</td><td>$data[dsnnum]</td><td>$data[quality]</td><td>$data[delivdate]</td><td>$data[price]</td><td>$data[width]</td><td>$data[bookqty]</td><td>$data[term]</td><td>$data[destination]</td><td>$data[tradeterms]</td><td>$data[shipdate]</td><td>$data[shipqty]</td><td>$data[rpayment]</td><td>$data[supplier]</td><td>$data[factorycost]</td><td>$data[rmkcav]</td><td>[<a href=admin.php?view=invoice&inum=$data[db1num]>view</a>]</td><td>[<a href=admin.php?view=packinglist&plnum=$data[db1num]>view</a>]</td><td>[<a href=admin.php?view=edititem&enum=$data[db1num]>edit</a>]</td><td>[<a href=admin.php?view=deleteitem&delnum=$data[db1num]>delete</a>]</td></tr>";
}
echo "</table>";
echo "<input type=submit value='Create Invoice'>";
echo "<br><br>";
/*
Print our next/prev links and 1,2,3 etc...
I have examples of all this code in my original post but you can do it yourself too if you see the structure of $InfoArray). print_r() is your friend. Do print("<pre>"); print_r($InfoArray); print("</pre>");
*/
/* Print out our prev link */
if($InfoArray["PREV_PAGE"]) {
echo "<a href='?view=viewitem&page=" . $InfoArray["PREV_PAGE"] . "'>Previous</a>";
} else {
echo "Previous";
}
echo " | ";
// print number links
for($i=0; $i<count($InfoArray["PAGE_NUMBERS"]); $i++) {
if($InfoArray["CURRENT_PAGE"] == $InfoArray["PAGE_NUMBERS"][$i]) {
echo $InfoArray["PAGE_NUMBERS"][$i] . " | ";
} else {
echo "<a href='?view=viewitem&page=" . $InfoArray["PAGE_NUMBERS"][$i] . "'>" . $InfoArray["PAGE_NUMBERS"][$i] . "</a> | ";
}
}
/* Print out our next link */
if($InfoArray["NEXT_PAGE"]) {
echo " <a href='?view=viewitem&page=" . $InfoArray["NEXT_PAGE"] . "'>Next</a>";
} else {
echo "Next";
}
echo "<br>";
echo "Displaying page " . $InfoArray["CURRENT_PAGE"] . " of " . $InfoArray["TOTAL_PAGES"] . "<BR>";
echo "Displaying results " . $InfoArray["START_OFFSET"] . " - " . $InfoArray["END_OFFSET"] . " of " . $InfoArray["TOTAL_RESULTS"] . "<BR>";
?>
</form>
and here's the invoice.php file,
<form action=invoice2.php method=post target=_blank>
<input type=hidden name=inum value=<?echo"$inum";?>>
<?
$dbi = mysql_fetch_array(mysql_query("SELECT * FROM db1 WHERE db1num = '$inum'"));
?>
<center>
Header:
<select name=header>
<option value=1 selected>Changshu New Shine Imp & Exp Co., LTD.</option>
<option value=2>Changshu Import&Export Overseas Trade Co., LTD</option>
<option value=3>Changshu Dayou Imp.&Exp. Co., LTD</option>
</select>
</center>
<br>
<table cellspacing=3 cellpadding=3 border=0 style="border-collapse: collapse" width=650>
<tr valign=top>
<td width=70%>
TO: <input type=text name=info9><br>
</td>
<td>
<br>
发票号码<br>
Invoice No.:<br>
日期<br>
Date
</td>
<td>
<br><br>
<u><?echo"$dbi[connum]";?></u><br>
<br>
<u><input type=text name=info1></u><br>
</td>
</tr>
</table>
<br><br>
<table cellspacing=3 cellpadding=3 border=0 width=650>
<tr><td>
<center>
<u><b>COMMERCIAL INVOICE</b></u><br>
</td></tr>
</table>
<br>
________________________________________________________________________________
<br>
<table cellspacing=3 cellpadding=3 border=0 width=650>
<tr>
<td width=500>
装运港 <br>
From <u><input type=text name=info2></u><br>
ETD: <u><input type=text name=info11></u><br>
信用证号码 <br>
Letter of Credit No. <u></u><br>
</td>
<td>
目的地 <br>
To <u><?echo"$dbi[destination]";?></u><br>
ETA: <u><input type=text name=info3></u><br>
开证行 <br>
Issued By <u></u><br>
</td>
</tr>
</table>
<br>
<table cellspacing=3 cellpadding=3 border=1 style="border-collapse: collapse" width=650>
<tr>
<td width=30%>
唛头标志 <br>
Shipping Mark<br>
</td>
<td width=40%>
品名及规格 <br>
Description of Goods<br>
</td>
<td width=30%>
总价 <br>
Total Amount<br>
</td>
</tr>
<tr valign=top>
<td>
<textarea name=info4 rows=4></textarea>
</td>
<td>
<textarea name=info12 rows=4 cols=50>
<?
foreach ($cb as $value) {
$query = "SELECT * from db1 WHERE db1num = '$value'";
$result = @mysql_query ($query);
while ($row = mysql_fetch_array($result)){
//$id = $row[0];
//$title = $row[2];
echo "$row[buyer]";
}
}
?>
<?echo"$dbi[quality]";?><br>
PO<?echo"$dbi[ordernum]";?> <br>
<?echo"$dbi[shipqty]";?>YDS AT <?echo"$dbi[price]";?>/Y CIF
</textarea>
</td>
<td>
<?echo"$dbi[tradeterms]";?> <input type=text name=info10><br>
<br>
<?echo"$dbi[rpayment]";?>
</td>
</tr>
<tr valign=top>
<td>
TOTAL:
</td>
<td>
<?echo"$dbi[shipqty]";?>YDS<br>
<br>
FABRIC PRICE FOB<br>
INSURANCE PRICE<br>
FREIGHT PRICE
</td>
<td>
<?echo"$dbi[rpayment]";?><br>
<br>
<input type=text name=info6><br>
<input type=text name=info7><br>
<input type=text name=info8>
</td>
</tr>
<tr>
<td>
CERTIFICATE OF ORIGIN
</td>
<td></td><td></td>
</table>
<blockquote>
WE HEREBY CERTIFY THAT THE<br>
ABOVE MENTIONED GOODS ARE OF CHINESE ORIGIN<br>
</blockquote>
<br>
<input type=submit value=Submit>
</form>
You can see the area where I used the code you gave me, I would like for that code to display the information for the items selected (checked) from the viewitems.php. I hope this helps, I might have been pretty unclear earlier.