CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 update record based on text box entrys

Print topic Send  topic

Author Message
teke507

Posts: 69
Posted: 07/05/2007, 6:11 AM

I have a Table called Audit which has about 27 fields 2 of which are called Bin and Loc
tyhe primary key of the table is called Serial number i want the user to be able to choose a bin and location then barcode scan the serial numbers that they wish to assign the current bin and location what i tried was to have a form that all it does lets the user input the bin and location in text boxes and submit that posts the data to the url...than the user has a second form on the same page that displays the bin and loc using CCGetFromGet...and asks the user for the serial number and then it should updatde the bin and loc where the serial number = the user inputed for value the problem is it doesnt work if i make it an insert function the button is there but the data doesnt show up if i make the button update the button doesnt even show up...this needs to be able to handle multiple serial numbers at a time being scanned in by a barcode scanner....thanks

the first form
----------------------------------------
| |
| ______________ |
| Bin| | |
| ------------------------ |
| ______________ |
| Loc | | |
------------------------- |
- ADD |
--------------------------------------

Second form

----------------------------------------
| ____________ |
| S/N | |\
| --------------------
| ______________ |
| Bin| | |
| ------------------------ |
| ______________ |
| Loc | | |
------------------------- |
- ADD |
--------------------------------------


View profile  Send private message
Wkempees
Posted: 07/05/2007, 7:56 AM

From the Examples, study the
http://examples.codecharge.com/ExamplePack/MultiStepReg...trationGrid.php

Build your two forms in this same way.

The only problem I expect from reading your post, is that your
primarykey is the serialnumber, which is obtained in formstep2.
It might work as per the example if you carefully study it and translate
it to your needs.
The reason I expect a problem lies in the fact that 'nomalized'
Serialnumber should not be a primarykey, as it is prone to changes.
I would prefer adding a Unique Autonum ID as a primary key, degrading
Serialnumber to be a Unique Index.
The Example is also based on a unique autonum ID being created in Form
one (insert) and used in Form two and next (update).
Hope you understand the problem I see.
I can help on the logical but not on the ASP coding.

Walter
Wkempees
Posted: 07/05/2007, 7:57 AM

Oops, you are not on ASP but a PhP.

Walter
teke507

Posts: 69
Posted: 07/05/2007, 8:08 AM

so theres no way to run an update sql query based on variables in my form without bringing the variables over to the next pageand querying the update for only the s/n from the previous page....let me rephrase ....to be able to update a record not know untill the user inputs the serialnumber which is on the same page as what changes..other wise i will have to use seperate pages and i woud like make it possible for the user to scan hundreds of S/Ns over and over with out having to go back to -the computer ...would a sql statement with a URL variable work?
View profile  Send private message
Wkempees
Posted: 07/06/2007, 4:48 AM

Teke507

There is always a way.
In fact your last post makes it a lot clearer to me what you intend to do.
I would solve it like this:
First page->Form with the Bin and Loc fields.
Store the user entered values for Bin and Loc in CCSetSession()
variables after you have done all your input checks.
In fact it could be a form not doing any insert or update.
Then you go to next page:

Form on your table Bin and Loc as Hidden, Serialnumber as input.
Before Show, CCGetSession() the Bin and Loc and assign them to the
hidden fields.
As this form is always called without URL, it will always be in Insert
mode, scan the serialnumber to the Serialnumberfield (make sure to use
the SetFocus action) and make sure the scanner generates the submit.

Think that covers it.

Walter

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.