Use DB record Loader passing more than one value
Hi,
Could not find the answer in the forums.
I used with success DB record Loader to show one record using one unique field value passed in the form URL.
I am trying to get a record by passing the value of 3 fields that together are unique and will call only one record to load in the form. I cannot figure out how to do this.
I tried:
In the DB record loader:
DB filed name = blank
Request param - passinfo
And Where statement:
`firstname` = '$firstname';
AND `name` = '$name';
AND `birthday` = '$birthday';
In the input form in the Redirect URL
in the params:
option=com_chronoforms
chronoform=Administration_login
passinfo={firstname, name, birthday}
Can you help me ?
Thank you very much in advance,
Could not find the answer in the forums.
I used with success DB record Loader to show one record using one unique field value passed in the form URL.
I am trying to get a record by passing the value of 3 fields that together are unique and will call only one record to load in the form. I cannot figure out how to do this.
I tried:
In the DB record loader:
DB filed name = blank
Request param - passinfo
And Where statement:
`firstname` = '$firstname';
AND `name` = '$name';
AND `birthday` = '$birthday';
In the input form in the Redirect URL
in the params:
option=com_chronoforms
chronoform=Administration_login
passinfo={firstname, name, birthday}
Can you help me ?
Thank you very much in advance,
Still working at it
I found out that in the input form I could send the 3 values doing this
option=com_chronoforms
chronoform=Administration_login
passinfo={firstname}
pasname={name}
pasdate={birthday}
But still not going anywhere as
In Record Found of the DB Record Loader
in the Where statement:
`firstname` LIKE 'passinfo'
AND `name` LIKE 'pasnom'
AND `birthday` LIKE 'pasdate'
Does not do it...
Thanks for any insight!
I found out that in the input form I could send the 3 values doing this
option=com_chronoforms
chronoform=Administration_login
passinfo={firstname}
pasname={name}
pasdate={birthday}
But still not going anywhere as
In Record Found of the DB Record Loader
in the Where statement:
`firstname` LIKE 'passinfo'
AND `name` LIKE 'pasnom'
AND `birthday` LIKE 'pasdate'
Does not do it...
Thanks for any insight!
SOLVED
This is what I put in the Where statement and it works like a charm
This is what I put in the Where statement and it works like a charm
<?php
$firstname= JRequest::getString('pasinfo', '', 'get');
echo "`firstname` LIKE '$firstname'" ;
?>
AND
<?php
$name= JRequest::getString('pasname', '', 'get');
echo "`name` LIKE '$name'" ;
?>
AND
<?php
$birthday= JRequest::getString('pasdate', '', 'get');
echo "`birthday` = '$birthday'" ;
?>
Everything worked fine until I tested many cases and found one that does not work!
If I have a compound name value, I get this error:
and the DB loader will not load the record with "Louis Charles" name value.
Any idea how to go around this?
Thank you in advance
If I have a compound name value, I get this error:
Array
(
[name] => LOUIS CHARLES
redirect_url_target_url: http://
Redirect URL: ?option=com_chronoforms&chronoform=Administration&pasinfo=LOUIS%2BCHARLES
and the DB loader will not load the record with "Louis Charles" name value.
Any idea how to go around this?
Thank you in advance
Hi delacoux,
Try making that
Bob
Try making that
$firstname= JRequest::getString('pasinfo', '', 'get');
$firstname = urldecode($firstname);
Bob
This topic is locked and no more replies can be posted.