Code: Select all
$from = $_POST['from'];
$to = $_POST['to'];
mysql_select_db($database_hostprop, $hostprop);
$query_rsPayments = "SELECT * FROM host_payments WHERE host_payments.payment_paid_timestamp >= '$from' AND host_payments.payment_paid_timestamp <= '$to' ORDER BY host_payments.payment_paid_timestamp";
$query_limit_rsPayments = sprintf("%s LIMIT %d, %d", $query_rsPayments, $startRow_rsPayments, $maxRows_rsPayments);
$rsPayments = mysql_query($query_limit_rsPayments, $hostprop) or die(mysql_error());
$row_rsPayments = mysql_fetch_assoc($rsPayments);Code: Select all
<form id="form1" name="form1" method="post" action="search.php">
<label for="from">From</label>
<input name="from" type="text" id="from" size="10" value="<?php echo $_POST['from']; ?>" />
<label for="to">to</label>
<input name="to" type="text" id="to" size="10" value="<?php echo $_POST['to']; ?>"/>
<input type="submit" name="button" id="button" value="Filter" />
</label>
<a href="search.php">
reset</a>
</form>Code: Select all
<table width="1000" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>Payment ID</td>
<td>Date Paid</td>
<td>User Name</td>
<td>Paid</td>
<td> </td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rsPayments['payment_id']; ?></td>
<td><?php echo date('D, d/m/Y',strtotime($row_rsPayments['payment_paid_timestamp'])); ?></td>
<td><?php echo $row_rsPayments['payment_userid']; ?></td>
<td><?php echo $row_rsPayments['payment_confirm']; ?></td>
<td> </td>
</tr>
<?php } while ($row_rsPayments = mysql_fetch_assoc($rsPayments)); ?>
</table>