I have a simple query that returns customer orders
<?php
require_once ('connection/mysql_connect.php');
$query = 'SELECT customers_name , customers_street_address , customers_city , customers_postcode , customers_state , customers_telephone , customers_email_address , date_purchased '
. ' FROM orders '
. ' WHERE date_purchased > \'2005-08-01 00:00:00\' AND date_purchased < \'2005-09-01 00:00:00\' LIMIT 0, 30';
$result = @ ($query);
if ($result) {
echo '<table align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="left"><b>1</b></td>
<td align="left"><b>2</b></td>
<td align="left"><b>3</b></td>
<td align="left"><b>4</b></td>
<td align="left"><b>5</b></td>
<td align="left"><b>6</b></td>
<td align="left"><b>7</b></td>
<td align="left"><b>8</b></td>
</tr>
';
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo
"<tr>
<td align=\"left\">$row[0]</td>
<td align=\"left\">$row[1]</td>
<td align=\"left\">$row[2]</td>
<td align=\"left\">$row[3]</td>
<td align=\"left\">$row[4]</td>
<td align=\"left\">$row[5]</td>
<td align=\"left\">$row[6]</td>
<td align=\"left\">$row[7]</td>
</tr>\n";
}
echo '</table>';
mysql_free_result ($result);
} else {
echo '<p>these fields could not be displayed due to a system error</p><p>' . mysql_error() . '</p>';
}
mysql_close();
?>
I would like to be able to have the shipping dept be able to choose the dates thru a form and return that value and plug it into the query instead of the
WHERE date_purchased > \'2005-08-01 00:00:00\' AND date_purchased < \'2005-09-01 00:00:00\' LIMIT 0, 30';
like it is in the existing query
Any Help is Greatly Appreciated!