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

Log-Out log-out at yacobi.com
Tue Sep 21 08:36:38 MDT 2004


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



More information about the FX.php_List mailing list