Skip to content
Discussion options

You must be logged in to vote

The ?id= is what breaks it. SQLPage appends ?search=... to whatever string you put in options_source, so the URL it actually fetches is:

/options/gearbox?id=3?search=red

That's one parameter, id, holding the value 3?search=red. There's no search parameter at all, so $search is NULL, label like NULL is NULL, and you get zero rows. Open that URL in your browser and you'll see the empty array come back.

So do the lookup inside gearbox.sql instead of passing it in. Set $id_user from the session cookie there, same as you do on the form page:

select 'json' as component;

select id_gearbox as value, id_gearbox as label
from tu_to_gb
where id_worker = $id_user
  and id_gearbox like coalesce($sea…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@monsieurmerle
Comment options

Answer selected by monsieurmerle
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants