I am trying to send an email with both the master (order) and detail (details)that both contain the(order_id)and I am getting errors.
global $dal;
$dal_TableName = $dal->Table("order");
$body="";
foreach(@$keys as $keyblock){
$arr=split("&",refine($keyblock["order_id"]));
if(count($arr)<1)
continue;
$arr2=array();
$arr2["order_id"]=urldecode(@$arr[0]);
$where = KeyWhere($arr2);
$rstmp = $dal_TableName->Query($where,"");
$datatmp=db_fetch_array($rstmp );
$body .= $datatmp['order_id'] ."\n";
$body .= $datatmp['pieces']."\n";
}
// send the email
$email="sample@test.com";
$subject="Order Complete";
$arr = runner_mail(array('to' => $email, 'subject' => $subject,
'body' => $body));