Forum Moderators: coopster

Message Too Old, No Replies

Var and array

Introducing a var in an Array

         

henry0

8:13 pm on Jul 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To populate a form that feeds data typed in by a member in need of a new added service
I use an Array (as the following one) that is used to write to many fields including user_name
and send those data to a db A (note I said DB A)

$fields_displayed = array( many fields, user_name);

the new service is fed by DB A

I also run on the same server a DB B, which contains
the member’s registration data
I would like the user (logged in) to be able to see his username at the bottom of the form used to enter new data without having to type it again

So the question is
How can I introduce a var in the array that will grab the username from the second DB

can I do something like

$fields_displayed = array( many fields, $user_name);

where $username will sit atop the code and provide query and grab the user name from DB b
Thank you

Regards

vincevincevince

5:20 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes, you can, just like that

henry0

5:49 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vincevincevince
thanks I was not sure about introducing a var.