Re: Updating Multiple rows with Combo Box!
| From: | Rahul S. Johari | Date: | Mon, 22 Aug 2005 13:35:55 +0000 |
| Subject: | Re: Updating Multiple rows with Combo Box! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221084@lists.php.net to get a copy of this message | ||
Ave,
I guess the last query I tried was simply updating the database with the
value of the Hired form field:
$sql = "UPDATE contactdata SET hired='$hired' WHERE ID='$thisID'";
$result = mysql_query($sql) or DIE("Fatal Error: ".mysql_error());
I've tried using an array and running the query in a loop... Everything
seems to just set the Hired field to "NO" for all records/rows, in the
database, or not change anything at all!
Thanks.
On 8/22/05 9:27 AM, "Jay Blanchard" <jay.blanchard@niicommunications.com>
wrote:
> [snip]
> <input type="hidden" name="thisID" value="<?php echo
> $row_tjContactFormData['ID']; ?>">
> <SELECT name="hired">
> <option value="YES" <?php
> if($row_tjContactFormData['hired']=="YES") { echo "Selected"; }
> ?>>YES</option>
> <option value="NO" <?php
> if($row_tjContactFormData['hired']=="NO")
> { echo "Selected"; } ?>>NO</option>
> <option value="NULL" <?php
> if($row_tjContactFormData['hired']==NULL) { echo "Selected"; } ?>>On
> Hold</option>
> </SELECT>
>
> But none of my Queries are working. What I want to do is, when the form is
> submitted, it should just simply update the Œhired¹ field with whatever
> value has been selected for that row in the Combo Box.
> [/snip]
>
> Can you post the query you are using?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180
Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: rahul@informed-sources.com
http://www.informed-sources.com