|
Posted by dba on 10/17/07 02:09
My output is as follows:
*********************************************************************************************
you entered display1.php
Array ( [cccb_id] => 00007 [selection] => 00008Executive Committee )
selection is: 00008Executive Committee
member_id is: cccb_id is: 00007
**********************************************************************************************
Now, as you can see from the about output, the array cccb_id indicates
00007 while I also get 00008 which is correct. The 00007 is the last row
selected from the database. The name of the committee "Executive
Committee" is correct. So part of the data being returned is correct by
part is not. The part that is not is the 'input type="hidden" as
indicated in the initial thread.
Also, I appreciate critical remarks about my code but would like an
explanation. If I was sloppy enough to make the mistake I probably did
not know it was sloppy or why it was sloppy. Please elaborate.
Gary L. Burnore wrote:
> On Wed, 17 Oct 2007 01:19:43 GMT, dba <dba@somewhere.org> wrote:
>
>
>>Without giving a lot of script at this time, I am having a problem with
>>php and form input type="hidden". Problem is that the hidden variable
>>displays last line from database query.
>>
>>Some code.
>>if ($field_name=="member_lname") {
>>echo "<input type='radio' name='selection' value=' " .
>>$result['member_lname']. ',' .$result['member_fname'] ." ' > " .
>>$result['member_lname'] . ', ' . $result['member_fname'] . "<br />";
>
>
>
>>echo "<input type='hidden' name='member_id' value=" .
>>$result['member_id'] . " ' >" . $result['member_id'] . " />" ; }
>
>
> This would return:
>
> <input type='hidden' name='member_id' value=NNNN ' > NNNNN />
>
> Bet that's not what you want.
>
> Oh, and ; } is sloppy programming.
>
>
>
>
>
>
>>produces this from form:
>>Back, Joe 0026
>>Clan, Bill 0025
>>Dant, Norbert 0020
>>Cleene, Nor 0013
>>De Wa, Frank 0012
>>Erick, B.C. 0006
>>Evans, Mary 0027
>>Far, Steve 0005
>>
>>after selection from form $_POST produces
>>correct name "Dant, Norbert" but grabs last number "0005" and not "0020".
>>
>>Any help would be appreciated.
Navigation:
[Reply to this message]
|