[FX.php List] Search for records by date range

Kim Hawksworth hawksworth-2 at medctr.osu.edu
Tue Sep 21 11:56:15 MDT 2004


Thank you!  This is exactly what I need.  I must get out of the mind set that only the field names can be passed as $_POST varialbles. 

Kim David Hawksworth, R.Ph., Web Manager
The Ohio State University Medical Center
Department of Pharmacy

>>> log-out at yacobi.com 9/21/2004 10:36:38 AM >>>
El 21/09/2004, a las 14:52, Kim Hawksworth escribió:

> I have a database that I would like to be able to search by date range.
>   I have a field in the database called "date" which auto-enters the
> record's creation date.   Under CDML I used the following code in an
> html form to search records by date range:
>
>> From Date: <input type="hidden" name="-op" value="gte"><input
> type="text" name="date" value="">
> To Date: <input type="hidden" name="-op" value="lte"><input type="text"
> name="date" value="">
>
> Is there an easy way to do this with FX.php?  If I use this same code
> with FX.php, it only returns records with the "To Date".

I use:

///the form
<form  action="the_query.php" method="post" ...>
<input type="text" name="from_date">
<input <input type="text" name="to_date">

///the response file: the_query.php

$query = new FX($serverIP, $serverPort);
[...]
$range_date = $_POST["from_date"]."...".$_POST["to_date"];
$query->AddDBParam("date_field", $range_date)
[..]
$query->FMFind();

Log-Out
Spain

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org 
http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list