You are here: Re: [PHP] Updating Multiple rows with Combo Box! « PHP « IT news, forums, messages
Re: [PHP] Updating Multiple rows with Combo Box!

Posted by "Rahul S. Johari" on 08/22/05 16:45

Ave,

register_globals are On.
I think the problem lies in the fact that I'm trying to update multiple rows
in the table, I'm not sure that my query with the UPDATE statement is
updating all the rows with what is being set in the value of the Form Field.

I'm not sure.


On 8/22/05 9:39 AM, "Jay Blanchard" <jay.blanchard@niicommunications.com>
wrote:

> [snip]
> 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!
>
>> <input type="hidden" name="thisID" value="<?php echo
>> $row_tjContactFormData['ID']; ?>">
> [/snip]
>
> Have you echoed out the query to see that it is correct? Do you have
> register_globals ON? If not you need to use the $_GET or $_POST array
> depending on the form method....
>
> $sql = "UPDATE contactdata SET hired= '".$_POST['hired']."' WHERE
> ID='".$_POST['thisID']."' ";

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация