Form Selection Help Needed
Posted: Wed Aug 05, 2009 4:47 pm
Good afternoon to everyone, I have a dilemma on my hands, well to me it is, can anyone be so kind as to assist me.
Below is my statement for a form for which I need the user to input the date and select a user and return the records that the user have inputted over a period of time.
I got the portion for the date to work fine, however I am not sure how I go about collecting the selection made from the form in order to return the desired result.
Please help if you can.
Thank you
Below is my statement for a form for which I need the user to input the date and select a user and return the records that the user have inputted over a period of time.
I got the portion for the date to work fine, however I am not sure how I go about collecting the selection made from the form in order to return the desired result.
Please help if you can.
Thank you
Code: Select all
<?php
$dbcon = mysql_connect("localhost", "common", "admin");
if (!$dbcon)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inventory", $dbcon);
if($_POST["execsearch"] != "" && $_POST["fr_date"] != "" && $_POST["to_date"] != "")
{
#$result = mysql_query("SELECT * FROM customer" );
$query = "SELECT fname, lname, (SELECT CONCAT_WS(' ', fname, lname) FROM queuser WHERE username = createdby) AS createdby, createdtime, updatedtime, purpose, (SELECT CONCAT_WS(' ', fname, lname) FROM queuser WHERE username = updatedby) AS updatedby, comments, (SELECT description FROM branch WHERE customer.branchid = branch.branchid) AS branchid FROM customer WHERE updatedtime >= '".$_POST["fr_date"]."' AND updatedtime <= '".$_POST["to_date"]."'ORDER BY branchid";
$result=mysql_query($query, $dbcon);
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo strtoupper("<td>" . $row['fname'].' '. $row['lname']) . "</td>";
echo strtoupper("<td>" . $row['createdby']) . "</td>";
echo strtoupper("<td>" . $row['starttime']) . "</td>";
echo strtoupper("<td>" . $row['endtime']) . "</td>";
echo strtoupper("<td>" . $row['purpose']) . "</td>";
echo "<td>" . $row['updatedby'] . "</td>";
echo "<td>" . $row['comments'] . "</td>";
echo "<td>" . $row['branchid'] . "</td>";
echo "</tr>";
}
echo "</table>";mysql_close($dbcon);
}
?>