Subject | Re: GLOBAL Array |
---|---|
Author | anna_ppalm |
Post date | 2006-03-29T02:44Z |
--- In firebird-php@yahoogroups.com, "anna_ppalm" <anna_ppalm@...>
wrote:
in pageA.php
$NOME = $array_de_registros["$a"]['NOME'];
echo"$NOME <input type=hidden name='NOME[]' value=\"$NOME\"
size=\"40\" maxlength=\"40\" />";
Nome came from DB and it was shown and past to pageB.php
On pageB.php
I claim it back and pass on to the page by doing this:
$NOME = $NOME[$a];
One tricky think is how to save the value of $a. I did a very lame,
but easy solution, out on the submit bottom and retrive as a
substring.
Thanks,
Anna
wrote:
>user
> --- In firebird-php@yahoogroups.com, "Alan McDonald" <alan@> wrote:
> >
> > > Hello,
> > >
> > > Hope you can help me. I am bringing from the DB several records,
> > > where only one will be update. This come to a PHP page. I am
> passing
> > > the values of each record to the php page. From this page the
> > > will choose one record. I than go back to the DB, get all theNAME
> > > information for that record and make available for update
> > >
> > > My problem is: I do not know how to differentiate the field
> fromget
> > > record 1 to NAME from record 2. I am using $_POST[`NAME'] to
> theIt works, thanks. Here is what I did:
> > > name, but if I have to update the first record I notice once I
> click
> > > submit it brings the information of the LAST record send to the
> page.
> > >
> > > I am trying to use an array of globals, but don't know how. Can
> you
> > > help?
> > >
> > > Example of what I need:
> > >
> > > Some how take the array that is coming from DB:
> > > $array_de_registros[$cont]['NOME'] = $NOME;
> > >
> > > Save it as a global array:
> > > $GLOBAL [$cont]['NOME'] = $array_de_registros[$cont]['NOME']
> > >
> > > Than be able to retrieve that specific record info to retrieve
> the db.
> > >
> > > How can I do that?? Any ideas??
> > >
> > > Thanks,
> > >
> > > Anna
> >
> > the page fieldname needs to be an array also
> > e.g.
> > this is a field with a checkbox
> > <input type=hidden name='hrecon[]' value=".$loanid."><input
> type='checkbox'
> > name='cbrecon[]' value=".$loanid." ".($C48=='Y'?'checked':'')." >
> >
> > Alan
> >
>
>
> I will try that Alan, Thanks
>
> Anna
>
in pageA.php
$NOME = $array_de_registros["$a"]['NOME'];
echo"$NOME <input type=hidden name='NOME[]' value=\"$NOME\"
size=\"40\" maxlength=\"40\" />";
Nome came from DB and it was shown and past to pageB.php
On pageB.php
I claim it back and pass on to the page by doing this:
$NOME = $NOME[$a];
One tricky think is how to save the value of $a. I did a very lame,
but easy solution, out on the submit bottom and retrive as a
substring.
Thanks,
Anna