This topic is locked

Advanced search and session variables

4/1/2010 10:06:35 AM
PHPRunner General questions
J
jdu001 author

Hello,
I have a report-page with an advanced search screen. I want to manipulate the results from the advanced search screen.

The sessionvariable $_SESSION["<table name>_asearchfor"] is empty:
$_SESSION["Overzicht aanwezigheid per lid_advsearch"]

O:11:"WhereClause":2:{s:6:"_where";a:8:{s:41:"Overzicht aanwezigheid per lid_asearchnot";a:1:{s:9:"Peildatum";b:0;}s:41:"Overzicht aanwezigheid per lid_asearchopt";a:1:{s:9:"Peildatum";s:13:"More than ...";}s:41:"Overzicht aanwezigheid per lid_asearchfor";a:1:{s:9:"Peildatum";s:10:"01-02-2010";}s:42:"Overzicht aanwezigheid per lid_asearchfor2";a:0:{}s:42:"Overzicht aanwezigheid per lid_asearchtype";s:3:"and";s:45:"Overzicht aanwezigheid per lid_asearchfortype";a:1:{s:9:"Peildatum";s:6:"date11";}s:37:"Overzicht aanwezigheid per lid_search";i:2;s:41:"Overzicht aanwezigheid per lid_pagenumber";i:1;}s:9:"_security";s:0:"";}
$_SESSION["Overzicht aanwezigheid per lid_asearchfor2"]

Array ( )
$_SESSION["Overzicht aanwezigheid per lid_asearchnot"]

Array ( )
$_SESSION["Overzicht aanwezigheid per lid_asearchopt"]

Array ( )
Do I have to fill these session variables by myself or how and when are they filled?
Greetings,
Jo van Duin

Sergey Kornilov admin 4/2/2010

Search-related session variables are populated after search is executed.

J
jdu001 author 4/2/2010



Search-related session variables are populated after search is executed.



Hello,
PHPRunner 5.1
Is there a way to use a field from the advanced search-form which is not in the query?
I have a table with 3 fields.
name, pdate and reason
Peter 12-21-2009, present

Peter 12-28-2009, not present

Jim, 12-21-2009, present

Jim, 12-21-2009, present

etc.
I want to make a report with all the names and for each reason a total for a period for which I want to use the advanced search screen.
SELECT name, reason, count(pdate) AS total

FROM ptable

GROUP BY name, reason

ORDER BY name, reason;
The result

name reason total

Jim

present 2

Peter

not present 1

present 1
Because the date is not in the query, PHPRunner doesn't create a search field.

I have tried it with a dummy date field, but then the between doesn't work.
Can you help me?
Greetings,
Jo

ficcionista 4/19/2010

Have you tried including the date in the query?

SELECT name, reason, pdate, count(pdate) AS total

FROM ptable

GROUP BY name, reason

ORDER BY name, reason;
J
Jane 4/23/2010

Jo,
to add field on the search page you need to add field to the SQL query on the Edit SQL query tab.