INSERT SELECT query and set values from add record dialog form

QuestionsINSERT SELECT query and set values from add record dialog form
Alphonse asked 5 years ago

My aim is to have a Toolbar Button or Custom Button

When a user clicks on it, add record dialog form is displayed, the user enters some values, in this case (Offer Status, Effective Date, Closing Date), on Submit button, the values of the form are passed to the INSERT SELECT query.

Below is the INSERT SELECT query

$g->execute_query(“INSERT INTO courses_on_offer (session_id,course_code,offer_status,effective_date,closing_date) SELECT s.session_id, c.course_code, ‘$offer_status’, ‘$effective_date’, ‘$closing_date’ FROM sessions s CROSS JOIN programme_courses c WHERE c.id IN ($selected_ids)”);

The italicized values (‘$offer_status’, ‘$effective_date’, ‘$closing_date’ ) should be passed from the add record dialog. Other values (session_id,course_code) are selected from table sessions and programme_courses

I hope this is clear now

Kindest Regards

 

 

 

1 Answers
Abu Ghufran Staff answered 5 years ago
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

0 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?