Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PHP-DB] Still having a form problem
I don't understand your problem exactly, but the ghist of it makes me think
you might want to do something like this.

Sounds like you are just trying to tie id's from a database to specific
fields on your screen?

If so, you can force the index name to be pretty much anything (for
example, the id field from your database).

Rather than using <input name="quantity[]" ..., get your php code when it
is generating the html to put your id value in as an index.

ie. echo '<input name="quantity['.$id_from_database.']" ...

On submission of your form, you should be able to just go..

foreach ($_REQUEST['quantity'] as $id_from_db => $input_fld_value) ...


hope this helps ... Ross

At 05:07 AM 31/05/2005, you wrote:
>Hi there everyone,
>
>
>
>I'm still having problems with my form PHP data, I lost email for a couple
>of days due to a server crash on my account so don't know if this was
>answered or not (Sorry).
>
>
>
>Basically, I have a form which populates 25 entries at a time from a MySQL
>DB with PHP, you can select the product you want to order by entering a
>value in the quantity box, if it was a single box it wouldn't be a problem,
>but it's an array.
>
>
>
>Now again, an array for the quantity is no problem at all, as I just use
>
>
>
><input name="quantity[]" type="text" class="style8" id="quantity[]" value="
"
>size="5">
>
>
>
>HOWEVER, I also need to transfer the $id (Named $id_new) from the database
>in each quantity array at the same time so I can split each array into ID
>and QUANTITY, this way I know which ID has which quantity, but this is what
>has me stumped.
>
>
>
>I tried with a HIDDEN field but of course that won't work, as there's no wa
y
>of aligning which ID goes with which quantity, so what I guess I need to
>know, is how to amend $id_new with the quantity[] array.
>
>
>
>Any help would be REALLY appreciated as this is really urgent.
>
>
>
>Chris


. Ross Honniball                  JCU Bookshop Cairns Supervisor
. James Cook Uni, McGregor Rd, Smithfield, Qld. 4878,  Australia
. Ph:07.4042.1157  Fx:07.4042.1158   Em:ross@bookshop.jcu.edu.au

Report this thread to moderator Post Follow-up to this message
Old Post
Ross Honniball
06-01-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:37 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.