A little hlep with logic
Posted: Wed Jan 30, 2008 8:43 am
Hey guys,
Sorry in advance for the long post but I have to explain what is happening so you can see the logic I am trying to use.
I am building an intranet site for my company that will keep track of our packages as they move through the warehouse. Things are going well and I am learning a lot about php. My newest endeavor is to build an INSERT form that would take two pieces of information from a hand held scanner and put it into MySql. The info would be the package number and the status (or station).
I have already made an easy little drop down form for the office staff to do one package at a time as the paper work goes into the warehouse but I need a form that would do a batch job for them. He wants to be able to preselect his zone and then scan about 30 packages to send the batch out.
Here is what I have been thinking:
I could send him to a page that allows him to choose a zone. Based on that choice I would hard code the 'status' field into the insert and allow the package number to come from the form input.
The problem I am having is this:
If I put one form on the page I can make the scanner scan the code and then hit enter so the scan goes through but when the page refreshes (I am using POST) it is no longer in the form and it requires a click back into the form (no good).
I could do a page with multiple row inserts based on a thread at
http://www.desilva.biz/mysql/insert.html
but if I write a page with 30 form fields and he enters 25 then wouldn't I get a bunch empty fields? I could set the database to reject null in the package field but then he would get an error. (again not the best solution)
So here is the question. Is there a better logical way to go about this? Does anybody have a good idea? Maybe a different type of form page?
Sorry in advance for the long post but I have to explain what is happening so you can see the logic I am trying to use.
I am building an intranet site for my company that will keep track of our packages as they move through the warehouse. Things are going well and I am learning a lot about php. My newest endeavor is to build an INSERT form that would take two pieces of information from a hand held scanner and put it into MySql. The info would be the package number and the status (or station).
I have already made an easy little drop down form for the office staff to do one package at a time as the paper work goes into the warehouse but I need a form that would do a batch job for them. He wants to be able to preselect his zone and then scan about 30 packages to send the batch out.
Here is what I have been thinking:
I could send him to a page that allows him to choose a zone. Based on that choice I would hard code the 'status' field into the insert and allow the package number to come from the form input.
The problem I am having is this:
If I put one form on the page I can make the scanner scan the code and then hit enter so the scan goes through but when the page refreshes (I am using POST) it is no longer in the form and it requires a click back into the form (no good).
I could do a page with multiple row inserts based on a thread at
http://www.desilva.biz/mysql/insert.html
but if I write a page with 30 form fields and he enters 25 then wouldn't I get a bunch empty fields? I could set the database to reject null in the package field but then he would get an error. (again not the best solution)
So here is the question. Is there a better logical way to go about this? Does anybody have a good idea? Maybe a different type of form page?