CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 PHP/MySQL passing date/age parameters problem

Print topic Send  topic

Author Message
Valdi
Posted: 01/25/2002, 6:38 PM


When I search my db fields containing birth dates,
I pass a varying pair (range) of ages (as parameters,
e.g.: 20 and 30) from Search form to the Grid Form
(separate pages).

On Open event of the resulting Grid Form I call the
function "BornMe" to modify passed parameters to the
proper dates range, as in fact I search corresponding
birthdates.

Grid Form correctly displays table containing all the
pepeople that were born between these dates. As for now,
everything goes well but when I jump from here to
Record Form to see more details, and return back to the
Grid - passed parameters "expires" although I have them
checked as transited....

As I clearly know, to make passed parameters obligatory
in this case, I should insert them under SQL Tab as
"Where" condition. Well - I got SQL syntax or parse error
everytime I try to do that! I know I am not too good in
PHP/MySQL programming, so I would appreciate any help
with it. My Open event code of the Grid Form is:

if (get_param("s_date") != "") // s_date is in fact age
{
$date_start=BornMe(get_param("s_date"));

// BornMe function calculates birth date of the person
// that ahould have age that I look for

$sWhere = str_replace(get_param("s_date"), $date_start, $sWhere);
}

if (get_param("e_date") != "") // similiar as above...
{
$date_end=BornMe(get_param("e_date"));
$sWhere = str_replace(get_param("e_date"), $date_end, $sWhere);
}

How to state the same under SQL Tab as Where condition???

Thanks in advance,
Valdi
Nicole
Posted: 01/26/2002, 2:07 AM

Valdi,
to preserve the search results you should add "s_date" and "e_date" parameters as Input parameters on result Grid form, mark them as 'Transfer'. You should pass them to record from and back to Grid. To do it, select 'Add Transit Parameters' checkbox on URL field properties. Add "s_date" and "e_date" parameters as Input parameters for Record form and mark them as 'Transfer'.
The second way is to store them into session. In Open event of Grid form use the code like:
if (get_param("s_date")!="")
set_session("s_date", get_param("s_date");
if (get_param("e_date")!="")
set_session("e_date", get_param("e_date");
$date_start = BornMe(get_session("s_date"));
$date_end = BornMe(get_session("e_date"));



Valdi
Posted: 01/28/2002, 4:01 PM

Nicole,
Thank you very much! Works just exellent!

Best Regards,

Valdi

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.