Reply
GLOBAL Array
Old 03-28-2006, 03:31 PM GLOBAL Array
Junior Talker

Posts: 2
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 user
will choose one record. I than go back to the DB, get all the
information for that record and make available for update

My problem is: I do not know how to differentiate the field NAME from
record 1 to NAME from record 2. I am using $_POST[`NAME'] to get the
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
apalm is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-28-2006, 09:48 PM Re: GLOBAL Array
Junior Talker

Posts: 2
I found the solution.

Here is what I did:


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 back 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, added the value of $a to every submit bottom and retrive as a substring.


Thanks,
Anna

Last edited by apalm : 03-28-2006 at 09:50 PM.
apalm is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to GLOBAL Array
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12792 seconds with 12 queries