CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Merging records (CCS, MySQL, php)

Print topic Send  topic

Author Message
Per
Posted: 08/28/2002, 2:18 AM

Has anybody got a tip (or readings) on how to merge records (string value) for these two situations?:

1. When creating a mailing using the send email event in CCS. For email message body it is now possible to pull the content from one table field. If I want to personalize such a mailing and include name of recipient, message and more items in the message body, how could I achieve that?

2. When inserting records in a table and part of the record should be default. E.g. inserting image paths in order to retrieve images in a gallery grid. Suppose all images have a unique number such as 6520_34, where 6520 is the serial number of the contact sheet and 34 is the actual image number. At insert I would like the user to type 6520_34 at a maximum (34 would be ideal but that would require retrieving contact sheet number from one table before starting on image insert record), but that the record will add the suffix .jpg and if necessary also a folder. When retrieving the grid will receive the record: images/6520_34.jpg, or some other defaults I might choose.

Thanks
per
Nicole
Posted: 08/28/2002, 11:36 PM

Per,
1. to include user's relevant information into mail body in addition to field value you should look up this information and concatenate it with the variable where mail message is stored. Use CCS CCDlookUP() function. E.g.:
ASP
user_name = CCDLookUp("user_name", "users_table", "user_id=" CCToSQL(form_name.user_id_field.Value, ccsInteger))
message_body = message_body & user_name
' send mail code generated by CCS goes here
...
.Subject = "Notification"
.Body = message_body
.BodyFormat = 0
...

2. you can let user enter only picture number and retrieve other field parts in the form Before Insert/Before Update events. Again I suppose that you need CCDLookUP() function to get value from another table. After that you can create full field value. E.g.:
form_name.image_field_name.Value = "images/" & lookedup_number & "_" & form_name.image_field_name.Value
Per
Posted: 08/29/2002, 1:42 AM

Thanks Nicole,
What do you think is better on my example on storing images:

Only store the image number 34 in the table field and retrieving full path and image suffix when selecting for the grid, or inserting the redundant information in the table field? Redundant since the contact sheet table has an id to be found in the image table. What takes longer: extra sql or extra characters in the field?

And also, would you mind translating the code you provided to php?

thanks for the help
Per
(see my portfolio at www.perjansson.com)

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.