dies meine Index-Seite ist, wo die Suchfelder sind in.2 Eingabe der Suche Felder PHP MySQL
index.php
<form method="post" action="search.php?go" id="searchform">
<input type="text" name="Date">
<input type="submit" name="submit1" value="Search">
</form>
das ist mein search.php Seite
<?php
/* showing table after searching for date */
if(isset($_POST['submit'])){
if(isset($_GET['go'])){
$Date=$_POST['Date'];
$query= mysql_query("SELECT ID,Name,Location,Date,Category,LabourSupplier,InTime,OutTime,Day,DayRate,Salary,OTHours,OTrate,OTAmount,Allowance2,TotalSalary,Advance,SalaryToHand FROM attendance WHERE Date LIKE '%" . $Date . "%' ORDER BY location DESC, LabourSupplier ASC",$connection)
or die("Failed to query database" .mysql_error());
while($row=mysql_fetch_array($query)){
print "<tr>";
print "<td >" . $row['ID'] . "</td>";
print "<td >" . $row['Name'] . "</td>";
print "<td >" . $row['Location'] . "</td>";
print "<th >" . $row['Date'] . "</th>";
print "<td >" . $row['Category'] . "</td>";
print "<td >" . $row['LabourSupplier'] . "</td>";
print "<th >" . $row['InTime'] . "</th>";
print "<th >" . $row['OutTime'] . "</th>";
print "<th >" . $row['Day'] . "</th>";
print "<th >" . $row['DayRate'] . "</th>";
print "<th >" . $row['Salary'] . "</th>";
print "<th >" . $row['OTHours'] . "</th>";
print "<th >" . $row['OTrate'] . "</th>";
print "<th >" . $row['OTAmount'] . "</th>";
print "<th >" . $row['Allowance2'] . "</th>";
print "<th >" . $row['TotalSalary'] . "</th>";
print "<th >" . $row['Advance'] . "</th>";
print "<th>" . $row['SalaryToHand'] . "</th>";
print "</tr>";
}
}
}
print "</table>";
?>
I Ich möchte ein weiteres Suchfeld hinzufügen, in dem ich sowohl Datum als auch Ort in einer Suchschaltfläche suchen kann, um das Ergebnis zu erhalten, wenn das Anzeigendatum beider Standorte erfüllt ist.
einfach eine andere Eingabetextfeld hinzufügen, und verwenden Sie es mit Variable posten. – RJParikh