searching between two dates!
Posted: Wed Dec 25, 2002 5:13 am
i have this code to search the a database field between two dates:
please, 
this searches only one fields from a table on the database. however i like to have on my search form the possibility to search other fields on the table, something like:$result = mysql_query ("SELECT * FROM mybrothers
WHERE PROFTDAT1 BETWEEN '$begtemp' AND '$endtemp'
AND SDATFIN1 = ' '
AND MORTDAT1 = ' '
ORDER BY PROFTDAT1 ASC, CNOMEN
",$conn);
$resultall = mysql_query ("SELECT * FROM friarsofmconv");
$totalrecs = mysql_num_rows($resultall);
$totalrows = mysql_num_rows($result);
if ($row = mysql_fetch_array($result)) {
do {
echo "<table bgcolor=#35669A border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#111111 width=100%>
<tr><td align=left width=88% valign=top><b><font face=Verdana size=2 color=#0000FF></font></b></td>
<td bgcolor=#FFFFFF align=right width=12% valign=top><b><font face=Verdana size=1 color=#008000>code:</font></b> <font face=Verdana size=1 color=#111111>{$row['IDNUMF']}</td></font></table>";
}
echo ("<p>");
echo ("<p>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";}
?>
but this gives me no result or errors! can anyone help$result = mysql_query ("SELECT * FROM friarsofmconv
WHERE PROFTDAT1 BETWEEN '$begtemp' AND '$endtemp'
WHERE NATDAT1 BETWEEN '$begbday' AND '$endbday'
AND SDATFIN1 = ' '
AND MORTDAT1 = ' '
ORDER BY PROFTDAT1 ASC, CNOMEN
",$conn);