Forums

Use DB record Loader passing more than one value

delacoux 17 Nov, 2011
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,
delacoux 17 Nov, 2011
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!
delacoux 17 Nov, 2011
SOLVED
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'" ;
?>
delacoux 22 Nov, 2011
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:

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
GreyHead 24 Nov, 2011
Hi delacoux,

Try making that
$firstname= JRequest::getString('pasinfo', '', 'get');
$firstname = urldecode($firstname);


Bob
delacoux 24 Nov, 2011
Wonderful!
It worked just fine. Thanks A LOT.
Very flexible tool. I am glad I chose it.
Céline
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger