CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> PHP

 hide form based on a query

Print topic Send  topic

Author Message

Posts: 48
Posted: 03/26/2013, 10:38 PM

Hi, I need to hide a Grid based on the result of a query, I'll do a Count(*) based on a url parameter, and if the result is not null (or =1) then display the grid, else, hide it.

I know how to hide the grid:

if (CCGetFromGet("s_employee_id",-1) == -1)
$Component->Visible = False;
$Component->Visible = True;

and it works fine, the problem for me is how to insert the query validation.

Thanks in advanced,
View profile  Send private message
Posted: 03/27/2013, 12:20 AM

In the grid's Before Show, add a Dlookup action and do your query. Set
the result to a variable.

Then, add another action for Hide/Show Component under the Dlookup
action above, and set to Hide, Expression and value: $MyVariable < 1

Posts: 48
Posted: 03/28/2013, 6:55 PM

I tried, but it doesn't worked:

//DLookup @105-EF7D4249
global $DBConn_TestDDBB;
global $ident_student;
$Page = CCGetParentPage($sender);
$ccs_result = CCDLookUp("id_student", "base_students", "id_student =".. CCGetFromGet("s_studentid",""), $Page->Connections["Conn_TestDDBB"]);
$ccs_result = intval($ccs_result);
$ident_student = $ccs_result;
//End DLookup

to check if the variable was filled, i added a textbox, and set the "retrieve value for control" to the variable: ident_student

but the textbox remains empty.
View profile  Send private message
Posted: 03/28/2013, 8:04 PM

"id_student ="..
Posted: 03/28/2013, 10:10 PM

Another way to see output is to use the 'Print Text' action. So after
the lookup add a Print Text action and set to: "ident_student: " .
$ident_student; exit

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

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