Antonio Manfredonio
|
| Posted: 03/04/2003, 12:42 AM |
|
Hi!,
I need to fill an array with a recordset for a faster performance, I'm using
CCb2, php, apache, mysql.
Also need INSERT this array after manipulation into database again, ...
Some one know how to accomplished that?
TIA all!
|
|
|
 |
DAVID
|
| Posted: 03/07/2003, 11:14 AM |
|
I use javascript. Record comes from a database with logical fields separated
by commas. Commas are not allowed in the logical data field (LDF is an email
address)
a full record looks like:
david@somedomain.com,mike@somedomain.uk,bob@somedomain.su
I read in this record into a hidden field (you may choose to use textarea
instead)
on page body load i have a javascript function that preloads two ListBoxes
"Selected" and "Available". each list box has onClick javascript event
handlers that allow transfer of clicked items from one to another. Those
events take care of validating list items, and rebuilding the hidden field
(call it "ToDatabase"). The listBoxes never get posted back to the server -
they are cleared on form submission onSubmit event. "ToDatabase" though does
get saved in the DB.
----------Interesting Note ----------
Keep in mind, that mysql has a very cool function FIND_IN_SET(str,str_list).
So immagine that you are writing a letter. Your address book contains 50
email addresses. When you start clean message all 50 are listed in the
"Available" and non in "Selected" (subsequently "ToDatabase" is also an
empty string).
1. Once you click on an element in the "Available" listBox, it gets moved to
"Selected" and appended via join to "ToDatabase"
2. If you save a draft with a few email addresses in To/CC/BCC,next time you
come back to your letter , "Available" only lists addresses that are not in
To/CC/BCC fields.
--------------------------------------
"Antonio Manfredonio" <fake-email@hotmail.com> wrote in message
news:b41ots$l33$1@news.codecharge.com...
> Hi!,
>
> I need to fill an array with a recordset for a faster performance, I'm
using
> CCb2, php, apache, mysql.
>
> Also need INSERT this array after manipulation into database again, ...
>
> Some one know how to accomplished that?
>
> TIA all!
>
>
>
|
|
|
 |
Antonio Manfredonio
|
| Posted: 03/10/2003, 7:00 AM |
|
Create a hidden query, then in BEFORE SELECT/Custom Code
this create an empty array
//Custom Code @17-2A29BDB7
// -------------------------
global $aFast;
$aFast=array();
// -------------------------
//End Custom Code
In a any database field BEFORE SHOW/Custom Code
Add a item into $aFast array
//Custom Code @18-2A29BDB7
// -------------------------
global $aFast;
global $dbind;
global $id_documento;
$aFast=array_merge($aFast, array($dbind->id_documento->GetValue()));
// -------------------------
//End Custom Code
-----------------------------------------------------------------
Thanks a lot at everyone!
|
|
|
 |
|