23 lines
709 B
PHP
23 lines
709 B
PHP
<?php
|
|
|
|
include "db.php";
|
|
|
|
$query = "select school_num,order_num,count(*) as num from user_account where transaction_type = 'Order' and order_num > 0 group by 1,2 having count(*) > 1";
|
|
$results = db_query($query);
|
|
|
|
$prev_school = 0;
|
|
while ($row = db_fetch_assoc($results)) {
|
|
extract($row);
|
|
|
|
if ($school_num != $prev_school) {
|
|
$school_name = db_getVal("SELECT school_name FROM schools WHERE record_num = $school_num");
|
|
echo("$school_name\n");
|
|
$prev_school = $school_num;
|
|
}
|
|
|
|
$odate = db_getVal("SELECT transaction_datetime from user_account where school_num = $school_num and order_num = $order_num limit 0,1");
|
|
printf(" %10d %5d %s\n",$order_num,$num,$odate);
|
|
}
|
|
|
|
?>
|