Fetching Perameter form URL for prepared statment

99 views
Skip to first unread message

kunwars...@gmail.com

unread,
Nov 10, 2016, 8:58:05 AM11/10/16
to Fusio
Hi,

How can I get the parameter passed in URL?
example loclhost/fusio/public/index.php/test1?Name=abcd
where Test1 is action rout and Name is a variable (must be treated as one and ABCD s value.

kunwars...@gmail.com

unread,
Nov 10, 2016, 8:58:35 AM11/10/16
to Fusio, kunwars...@gmail.com
This is useful when preparing a fetch prepared statment

kunwars...@gmail.com

unread,
Nov 10, 2016, 9:01:57 AM11/10/16
to Fusio, kunwars...@gmail.com
Please verify if this works?
select rfiduid from rfid_uid where rfiduid = {{ request.uriFragment("Name")|prepare }}


On Thursday, November 10, 2016 at 5:58:05 AM UTC-8, kunwars...@gmail.com wrote:

Christoph Kappestein

unread,
Nov 10, 2016, 1:14:07 PM11/10/16
to Fusio, kunwars...@gmail.com
Hi,

so in order to access GET parameters in the SQL action you have to use the parameters property i.e.:

SELECT rfiduid FROM rfid_uid WHERE rfiduid = {{ request.parameters.get('Name')|prepare }}

best regards
Christoph

 
Message has been deleted
Message has been deleted

kunwars...@gmail.com

unread,
Nov 10, 2016, 7:44:44 PM11/10/16
to Fusio, kunwars...@gmail.com
Tried :
http://localhost/api/public/index.php/validate_rfid/?Name=1234fdsa
Getting:
{
    "success": false,
    "title": "Internal Server Error",
    "message": "Entry not available"
}
Query working fine:
SELECT rfiduid FROM rfid_uid WHERE rfiduid = '1234fdsa'

Christoph Kappestein

unread,
Nov 11, 2016, 2:23:22 AM11/11/16
to Fusio, kunwars...@gmail.com
So it looks like there is no entry in the table with the id
rfiduid = '1234fdsa'

Could you test this with an id of an existing row?

Er. Surya Partap Singh Pathania

unread,
Nov 11, 2016, 2:35:22 AM11/11/16
to Christoph Kappestein, Fusio

Actually there is an entry in the table. I am give you access and probably you can see it , ideally it should come with response.

kunwars...@gmail.com

unread,
Nov 15, 2016, 5:26:35 AM11/15/16
to Fusio, christoph....@googlemail.com, kunwars...@gmail.com
Can you please help with issue identification? is there anyway I can send you login details?

Dejan Gambin

unread,
Nov 8, 2021, 5:42:52 PM11/8/21
to Fusio
Hi

I am also trying to use GET parameters in my select statement but it doesn't work with {{request.parameters.get('some_param'}}

Am I doing something wrong?

regards, dejan

Reply all
Reply to author
Forward
0 new messages