close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding binding data to email body

Thread began 7/16/2010 3:03 pm by Badger | Last modified 7/21/2010 4:10 pm by Dani Chankhour | 986 views | 7 replies |

Badger

Adding binding data to email body

Hi

I've added UE to a product details page to send an email from that page with information from a recordset and a FB form. It was working perfectly but after some amendments the recordset info stopped appearing in the email. I've replaced it with a backup to when the email was working, tried starting from scratch, checked the SQL and just can't get anything in the table using the bindings panel to appear in the email.

Any ideas what to look for.

B

Sign in to reply to this post

Eric Mittman

You can open up the recordset that the values should be coming from to check it for accuracy and the filtering. If the filtering is off, or there is a problem with the filtered value then the recordset will not contain the correct records.

What is the filtered value you are using and where does it come from? Are you able to confirm that the value is getting to the page where the recordset is filtered? Also, what happens if you hard code the filtering value and test it, do you get any records this way?

Sign in to reply to this post

Badger

Thanks Eric

A new simple recordset works so I can fix it from here.

B

Sign in to reply to this post

Eric Mittman

Glad to hear that, let us know if you have any other questions.

Sign in to reply to this post

Badger

Sorry Eric, spoke too soon.

The information I want in the email is appearing correctly in the page with UE. Just wont go onto the form.

It seems that it's using data from another session. IE it isn't grabbing the correct field info when I tried adding a simple additional recordset using the items table. I think it could be the order of the code of the data needs binding to another table? I've tried adding different variables but then it sees nothing. Maybe I need to hand code the original complicated recordset that gets to this point (loads of joins, sql etc)?

Currently the waue_Items_Detail_1.php file has the dynamic data as follows:

php:
//Start Mail Body
$MailBody = $MailBody . "<html><head></head><body>\r\n";
$MailBody = $MailBody . "<h1>Website quotation enquiry</h1>\r\n";
$MailBody = $MailBody . "<p>An enquiry has been made about the  following item:</p>\r\n";
$MailBody = $MailBody . "<p>Item name: ";
$MailBody = $MailBody .  $row_WADAItems['ItemName'];
$MailBody = $MailBody . "</p>\r\n";
$MailBody = $MailBody . "<p>Code: ";
$MailBody = $MailBody .  $row_WADAItems['ItemSKU'];
$MailBody = $MailBody . "</p>\r\n";
$MailBody = $MailBody . "<p>The enquiry is from: ";
$MailBody = $MailBody .  ((isset($_POST["Quotation_request_group_Name"]))?$_POST["Quotation_request_group_Name"]:"");
$MailBody = $MailBody . "<br />\r\n";



and the recordset on the details page looks like this:

php:
<?php
$ParamItemID_WADAItems 
"-1";
if (isset(
$_GET['ItemID'])) {
  
$ParamItemID_WADAItems = (get_magic_quotes_gpc()) ? $_GET['ItemID'] : addslashes($_GET['ItemID']);
}
$ParamSessionItemID_WADAItems "-1";
if (isset(
$_SESSION['WADA_Insert_Items'])) {
  
$ParamSessionItemID_WADAItems = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_Items'] : addslashes($_SESSION['WADA_Insert_Items']);
}
$ParamItemID2_WADAItems "-1";
if (isset(
$_GET['ItemID'])) {
  
$ParamItemID2_WADAItems = (get_magic_quotes_gpc()) ? $_GET['ItemID'] : addslashes($_GET['ItemID']);
}
mysql_select_db($database_connChan$connChan);
$query_WADAItems sprintf("SELECT Items.*, ItemMake.*, ItemStyle.*, ItemType.* FROM Items INNER JOIN ItemMake ON Items.MakeID = ItemMake.ItemMakeID INNER JOIN ItemStyle ON Items.StyleID = ItemStyle.ItemStyleID INNER JOIN ItemType ON Items.TypeID = ItemType.ItemTypeID WHERE ItemID = %s OR ( -1= %s AND ItemID= %s)"GetSQLValueString($ParamItemID_WADAItems"int"),GetSQLValueString($ParamItemID2_WADAItems"int"),GetSQLValueString($ParamSessionItemID_WADAItems"int"));
$WADAItems mysql_query($query_WADAItems$connChan) or die(mysql_error());
$row_WADAItems mysql_fetch_assoc($WADAItems);
$totalRows_WADAItems mysql_num_rows($WADAItems);

mysql_select_db($database_connChan$connChan);
$query_rsDescription "SELECT * FROM descriptions WHERE descID = 10";
$rsDescription mysql_query($query_rsDescription$connChan) or die(mysql_error());
$row_rsDescription mysql_fetch_assoc($rsDescription);
$totalRows_rsDescription mysql_num_rows($rsDescription);

mysql_select_db($database_connChan$connChan);
$query_rsHard "SELECT * FROM Items";
$rsHard mysql_query($query_rsHard$connChan) or die(mysql_error());
$row_rsHard mysql_fetch_assoc($rsHard);
$totalRows_rsHard mysql_num_rows($rsHard);?>
<?php 
require_once("webassist/email/mail_php.php"); ?>
Sign in to reply to this post

Eric Mittman

So long as the UE code is below these recordset declarations it seems like it should be working to me. What exactly is the result that you are getting with this now? Is it showing the wrong records in the email message? Have you been able to check on any of the values that come from this recordset to ensure that they are there to begin with?

Sign in to reply to this post

Badger

OK

I've done loads of elimination to see if I can get an idea what's working, what isn't and why.

Basically everything works (including items from the form appearing in the email) except the "items" fields added to the email from the recordset...

EXCEPT if I add a new product to the database; then that new product appears OK???!!??

If I then try to do it again with a previously recently added product that worked once before it doesn't appear in the email. Nor any other previously added item.

I've looked at the fields in the table using MyPHPadmin and can see no difference between what works and what doesn't.

Ideas:
1, Could this be a conflict with the "Add to cart" button server behavior?
2. Could this be a MySQL issue in my database IE a server problem (It's running MySQL 4)?
3. Or maybe a cache problem that a session is still running. Maybe need to kill the session??

One focusing problem is I can't get the search to work. Moreover, in the admin section when you perform a search (and something that should appear doesn't) when returning to "results" the list of products is gone. Only a cache refresh brings it back.

I've attached the page in question

Help!

Attached Files
Items_Detail.php.zip
Sign in to reply to this post

Dani Chankhour

I think the problem is in this session variable:

$_SESSION['WADA_Insert_Items']

When you insert a new product this session is created and it only gets updated if a new product is created. to fix this issue try clearing out this session on the insert page by adding the following lines of code to the top of your insert page:

<?php
if (!session_id()) session_start();
?>
<?php unset($_SESSION['WADA_Insert_Items']); ?>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...