-
I'm new to SQLPage. How to select an item from a table and pass it to an edit form? |
Beta Was this translation helpful? Give feedback.
Answered by
lovasoa
Dec 13, 2023
Replies: 1 comment 1 reply
-
Hello and welcome to SQLPage ! The easiest way to achieve what you want to do is to add an "edit" column to your table with a link to your edition page. Like so: select 'table' as component, 'action' as markdown;
select *, format('[Edit](edit.sql?id=%s)', id) as action from users; Then, in select 'form' as component;
select 'text' as type, 'Username' as name, username as value from users where id = $id;
update users set username = :Username where id = $id and :Username is not null; See the simple website example
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lozdown
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello and welcome to SQLPage !
The easiest way to achieve what you want to do is to add an "edit" column to your table with a link to your edition page. Like so:
Then, in
edit.sql
, you can have your form:See the simple website example
table.sql
edit.sql