Re: [PHP-DB] How do I... (update one table from one page which displays multiple editable tables)?

2002-12-09 Thread R'twick Niceorgaw
rewrite your  tags to have a name and a onSubmit() handler like:



Now inside each of your forms, have a hidden field named form_name like


Now put the following code within the  part on your page


RE: [PHP-DB] How do I... (update one table from one page which displays multiple editable tables)?

2002-12-09 Thread SELPH,JASON (HP-Richardson,ex1)

use a hidden variable in each form to tell which action to do.
i.e. each separate form embed this.


...
...
...



then do an if to decide which form was submitted and what action to perform.

if ((isset($HTTP_POST_VARS["form_number1"])) &&
($HTTP_POST_VARS["form_number1"] == "form1_action")) {
update my databases1
}

if ((isset($HTTP_POST_VARS["form_number2"])) &&
($HTTP_POST_VARS["form_number2"] == "form2_action")) {
update my databases2
}

etc.

Cheers
Jason

-Original Message-
From: Michael Knauf/Niles [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 1:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How do I... (update one table from one page which
displays multiple editable tables)?


I have a simple form that displays the values of some fields in a  table so
the user can edit those values and update the database. (mySql) the form
action is $php_self, and it triggers an update query that I haven't written
yet, because on the way there, I hit a small snag that I hope you can help
me with.

You see, I want to put 8 r 9 forms on the same page, each with the ability
to update one table within the database... but how can I tell which form
the user wants to change?

If my head was screwed on straight about this, that question might be more
comprehensible, but here's the code for the form, in case that clarifies
anything...





Products Table


ID:

FG#:

Name:

Description



Update Product Information




Michael


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php