私のテーブルには、入力がNew PurchaseまたはExisting Product のmain_stock
いずれかになるフィールドがあります。newown
newown
選択した日のフィールドでのすべての新規購入のレポートを作成したい-
まず、カレンダーから日付を選択してcurr_timestamp field
送信をクリックできるページがあります。
彼らが私がこれを必要とする日付を提出すると、これがphpページに運ばれ、newpurchase_report.php
その日に追加されたすべての新規購入が表示されます。何か助けは素晴らしいでしょうか?
ありがとうございました
これは現在、私の newpurchases_report.php です。
<?php
// connect to the database
$host = '...';
$username = '...';
$pass = '....';
mysql_connect($host,$username,$pass);
mysql_select_db("stock");
$curr_timestamp = $_GET['curr_timestamp'];
$thenumber = 1;
$data = mysql_query("SELECT * FROM main_stock WHERE curr_timestamp='$curr_timestamp' ORDER BY newown ASC ")
or die(mysql_error());
print "<table border cellpadding=1 width=95%>";
print "<span style='font-size: 22px;background-color : #ffff00;'>New Purchases</span>";
print "<tr>";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Number</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Data</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Master Category</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Category</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Product Description</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>New or Exsisting?/span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Barcode</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Serial No.</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Stockcode</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Status</span></td> ";
print "<td><span style='font-size: 12px;background-color : #ffff00;'>Hiretrack</span></td> ";
print "</tr> ";
while($info = mysql_fetch_array( $data ))
{
print "<tr> ";
print "<td><span style='font-size: 12px;'>". $thenumber++;"</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['curr_timestamp'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['mastercategory'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['category'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['product_desc'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['newown'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['barcode'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['serial'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['stockcode'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['status'] ."</span></td> ";
print "<td><span style='font-size: 12px;'>".$info['hiretrack'] ."</span></td> ";
print "</tr> ";
}
print "</table> ";
// disconnect from the database
mysql_close();
?>
編集が必要なのはこのページなのか、それとも私のインデックス ページ (カレンダーから日付を選択する場所) なのかわかりません。