rkiss
Posts: 14
|
| Posted: 09/25/2004, 6:54 PM |
|
Hi,
I am trying to the following, so for without any luck.
1, registration form
form text field name: username
I would like to automatically display a dynamic value into this form field.
Here is my SQL that would do the trick, however I do not know how to pass this value to the username form field. Any help is appreciated.
SQL:
"SELECT CONCAT('hpm',"",(max(rent_roll_id)+1))username";
Thank you
Roman
|
 |
 |
Nicole
Posts: 586
|
| Posted: 09/27/2004, 6:18 AM |
|
Roman,
Execute custom SQL query or call CCDLookUP() function to retrieve a value from a database in username Before Show event. CCDLookUp() is described in online docs: http://docs.codecharge.com/studio/html/index.html?http:...BValue.html?toc
_________________
Regards,
Nicole |
 |
 |
rkiss
Posts: 14
|
| Posted: 09/27/2004, 3:12 PM |
|
Hi,
I tried the CCDLookUp(), but the code still does not work
/rent_roll_username_BeforeShow @6-DFE45904
function rent_roll_username_BeforeShow()
{
$rent_roll_username_BeforeShow = true;
//End rent_roll_username_BeforeShow
//DLookup @84-0995558A
global $DBhpm;
global $rent_roll;
$result =(CCDLookUp(CONCAT('hpm',"_
",(max(rent_roll_id)+1)), rent_roll, "", $DBhpm);
$result = strval($result);
$rent_roll->username->SetValue($result);
//End DLookup
//Close rent_roll_username_BeforeShow @6-4DEFD218
return $rent_roll_username_BeforeShow;
}
//End Close rent_roll_username_BeforeShow
//DEL // -------------------------
//DEL global $rent_roll;
//DEL $SQL = "SELECT CONCAT('hpm',"_",(max(rent_roll_id)+1)) FROM rent_roll";
//DEL $db->query($SQL);
//DEL $db->close();
//DEL // Write your own code here.
//DEL // -------------------------
Any ideas what I am doing wrong.
I set this code for USERNAME form field.
Do I need to set the type of target and target as well?
Thanks for all your help
Roman
|
 |
 |
rkiss
Posts: 14
|
| Posted: 09/28/2004, 6:05 AM |
|
Hi,
Could someone please point me to the right direction please?
Thank you.
Roman
|
 |
 |
|