CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 help in code

Print topic Send  topic

Author Message
itzumar

Posts: 88
Posted: 11/24/2012, 11:04 PM

I used following code when my id is integer. can any body tell me what changes in this code i have to do if i used text id

global $acad;

//Update the hidden 'empid" field with the current empid
$empid = CCGetFromGet("s_empid",0);
if($empid != null) {
$acad->ds->empid->SetValue($empid);
}
_________________
Umar
View profile  Send private message
bannedone


Posts: 273
Posted: 11/27/2012, 9:39 AM

Should not have to change your code above at all..

You probably need to change the definition of your database field from integer to text

Also change the type for that field in CCS Data properties from Integer to Text.



_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2
View profile  Send private message
itzumar

Posts: 88
Posted: 11/27/2012, 9:44 AM

Yes you right i have to change data type. but what i used in
$empid = CCGetFromGet("s_empid",0);

in place of 0 for text field?

as we all knew 0 is integer
_________________
Umar
View profile  Send private message
bannedone


Posts: 273
Posted: 11/27/2012, 9:57 AM

$empid = CCGetFromGet("s_empid","0");

Do not forget the CCS Data property change to text in the IDE




_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2
View profile  Send private message
cleyan


Posts: 136
Posted: 11/27/2012, 2:25 PM

Hi

I see a problem in your code

  
global $acad;  
  
//Update the hidden 'empid" field with the current empid  
$empid = CCGetFromGet("s_empid",0);  
if($empid != null) {  
$acad->ds->empid->SetValue($empid);  
}   
  

$acad->ds->empid->SetValue($empid); will be allway executed because $empid will never be null, because the second parameter on CCGetFromGet() is the default value in case the parameter is missing

maybe is better to use

  
global $acad;  
  
//Update the hidden 'empid" field with the current empid  
$empid = CCGetFromGet("s_empid",'');  
if(strlen($empid)) {  
$acad->ds->empid->SetValue(intval($empid));  
}   

I hope this is helpful

Regards


Carlos

_________________
**************************************************
Carlos Leyan B.
Temuco, Chile
www.leytec.net
View profile  Send private message

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 http://support.yessoftware.com.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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