Current location: Hot Scripts Forums » Programming Languages » PHP » array() problem


array() problem

Reply
  #1 (permalink)  
Old 05-24-04, 04:19 PM
nekeno12 nekeno12 is offline
Wannabe Coder
 
Join Date: May 2004
Location: CO
Posts: 214
Thanks: 0
Thanked 0 Times in 0 Posts
array() problem

Okay, the system I'm working on is for a credit counselour. He get's some clients from Mortgage brokers, works on the clients file, and allows the broker to login to our system and see the results.

So, when a new client is added, I'm looking for a way to assign particular clients to particular brokers.

All the information is stored on a mysql database.

So, my idea is to take the id numbers for each client, and store the values in the sql database under the broker in a column called clientlist.

So the values stored, would be an array of like 1, 5, 6 in comma separated format.

Then when the broker logs on, he gets a list of just the clients with the key id's 1, 5, and 6.

Now, that's the best way to do it in my opinion. But how to code that is where I'm lost.

What's the best way to ADD to the values pulled from mysql and UPDATE them into mysql with the new client added to the broker.

For example, if Pulte Mortgage has clients 1, 2 but we want to add 3 to them and still have the comma separated format, what is the best way to do that?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 05-24-04, 05:55 PM
scriptsagency scriptsagency is offline
Newbie Coder
 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
You can update it easilly by selecting the value and adding to it the new id . For example to add to $string1 another text you just do $string1.="text added" ;
To separate the id's if you need to use only one you use $arrayy=explode(" , " , $string) ; and to create a string from an array you do $stringg=implode("," , $arrayy);
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
file into an array, then appending array only if no duplicates djpennin Perl 2 05-17-04 01:04 PM
mysql fetch array problem darkcarnival PHP 1 03-31-04 06:49 PM
Upload Script Problem!!! seanknighton Perl 0 03-21-04 09:54 PM
linking to iframe not working :( j0d JavaScript 5 01-19-04 08:14 PM
array problem bitesize PHP 2 09-10-03 08:08 AM


All times are GMT -5. The time now is 10:36 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.