Jump to content

Executing a query multiple times in a page


kirtney

Recommended Posts

Hello I am trying to create a web form that inserts user data. So how it works is that  a user selects a department (departmentQ) from the drop down list and is routed to a second page that displays the people in the selected department in a drop down menu. On this second page users are required to select one of the displayed people and then assign them to specific task and insert it into the database. What I would like to know if there is a way that I can code the page to automatically re-execute the deaprtmentQ query without the user having to physically go back to selecting a department page. 

Any assistance would be greatly appreciated 

You can easily pass DepartmentQ through the second form as a hidden field.

<input type="hidden" name="dept" value="departmentQ">

then

if (second page was submitted test here){
write to database
}
if (isset($_POST['dept']){
//do your query here and redisplay the list of people in Department Q here
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.