Hi experts, I have come here before asking for assistance in this scheduling application that I am creating and received great help. I have run into an issue recently and cannot figure out how to fix it. I am attempting to make an update screen for my application, where users can select a date and crew and echo the submitted schedule. This IS working. The issue comes in that I am echoing names into dropdowns as the first value, where the names are already existing. This is causing that name to appear once as echod, and again in the dropdown.
Is there a way I can select a name based off the echo'd value?
Trying to understand the issue here. I tried out a version of your code (adapted so that it will work here) - not sure what I am looking for though. The code itself has some issues that need to be addressed - for instance
The SESSION variables don't make sense - assigning a date to an ID field is confusing and you have this on lines 25-25
How must I change my data to see the problem and what am I looking for?
peter Ojeda
ASKER
Hi Julien thankyou for your input I am still relatively new to a lot of things so I am sure a lot of my code is either unnecessary or not in the best practice. The session variables on line 25 are coming from the previous page. I am passing these variables into $ID and $CREW, and am then passing those into strings which is passed into the $params (line 54) for the select query. I am attemping to make a scheduling program, where users can go back and modify a schedule that is set on a previous day. After the select statement I am attempting to echo the names from my sql database into the dropdowns as selected. So if "Bob" is echo'd into the dropdown, Bob will appear selected.
Hi sorry for the delay yes the function to not be able to select the same name twice is exactly what I was looking for. But if you see in my code I am echoing a name from my sqldb. I have attached some images below. As you can see, the name "Bishop, La" is being echo'd from my db schedule table. The rest of the value of the dropdown are being echo'd from my db table Employee_Names. If possible, I want to just have the employee name selected based off the value echo'd from the schedule db. ecample1.PNG example2.PNG
Hi Julien I'm sorry but I'm going to have to close the question. I found many more issues in my program that I need to fix first. I will come back to this question sometime in the future.
The SESSION variables don't make sense - assigning a date to an ID field is confusing and you have this on lines 25-25
Open in new window
And then this on lines 39 and 40Open in new window
- What is the $CREW variable for- where is SESSION set
- what is this page supposed to do
Here is my version of it http://www.marcorpsa.com/ee/t2310.php
How must I change my data to see the problem and what am I looking for?