How to forumalte values for database insertion.
Posted: Tue Sep 27, 2011 11:57 am
Hi all, i have a slight challenge.
I have a template that looks like this:
Message From CEO:
Message From Admin:
Message From Hr:
...
These messages are sent to staff members and reside in separate tables.
Each Staff member might have a message or might not have.
The supervisors of these staff desire to view the messages in a condensed format for each staff they supervise.
Eg:
Message From CEO:"Report To Me Once You Get In"
Message From Admin:"Submit Your Bank Account Details"
Message From Hr:"Submit Your Revised Cv"...
I need help on coding this such that for "EACH" staff, the supervisor phone number is picked and ONLY" the template entries that contain messages are selected, leaving blank templates behind:
E.g i don't want a blank entry like this:
Message From CEO:"Come Here"
Message From Admin:
The supervisors phones are also stored in a separate table, and the staff surnames are in a separate table.
The final input i need looks like this,the entries in square braces are taken from a table. ( i include the column headings)
Supervisor Phone Number Message For Staff
[11288768] The Member of Staff you are supervising.['last_name'],
has the following messages for Monday Sept 22:
Message From CEO:['ceo message'],
Message From Admin:['admin_message']
[1228997766] The Member of Staff you are supervising.['last_name'],
has.........
So how and where do i start?.Thanks for your help.
I have a template that looks like this:
Message From CEO:
Message From Admin:
Message From Hr:
...
These messages are sent to staff members and reside in separate tables.
Each Staff member might have a message or might not have.
The supervisors of these staff desire to view the messages in a condensed format for each staff they supervise.
Eg:
Message From CEO:"Report To Me Once You Get In"
Message From Admin:"Submit Your Bank Account Details"
Message From Hr:"Submit Your Revised Cv"...
I need help on coding this such that for "EACH" staff, the supervisor phone number is picked and ONLY" the template entries that contain messages are selected, leaving blank templates behind:
E.g i don't want a blank entry like this:
Message From CEO:"Come Here"
Message From Admin:
The supervisors phones are also stored in a separate table, and the staff surnames are in a separate table.
The final input i need looks like this,the entries in square braces are taken from a table. ( i include the column headings)
Supervisor Phone Number Message For Staff
[11288768] The Member of Staff you are supervising.['last_name'],
has the following messages for Monday Sept 22:
Message From CEO:['ceo message'],
Message From Admin:['admin_message']
[1228997766] The Member of Staff you are supervising.['last_name'],
has.........
So how and where do i start?.Thanks for your help.