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 |
 |
 |
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 |
 |
 |
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 |
 |
 |
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 |
 |
 |
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 |
 |
 |
|