A
|
ant author 2/12/2012 |
I've also tried adding this code to the event but I get a "Error description Undefined variable: where" |
C
|
copper21 2/16/2012 |
I've also tried adding this code to the event but I get a "Error description Undefined variable: where" global $conn,$strTableName; $strTableName="todo"; $email=$values["consult_info"]; $message=""; $subject="Sample subject"; $rs = db_query("select from " . $strTableName ." where ". $where,$conn); if($data=db_fetch_array($rs)) { foreach($data as $field=>$value) $message.= $field." : ".$value."\r\n"; runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $message)); } Its got something to do with line 41; $rs = db_query("select from " . $strTableName ." where ". $where,$conn);
|
A
|
ant author 2/16/2012 |
Hi Brian |
C
|
copper21 2/16/2012 |
Hi Brian Thanks for responding. I added onto the todo table and tried under these to events; Before record added //** Send email with new data **** After record added // Place event code here. I need the todo table to look up who the consultant is from consult info table and then send the todo item to the email for that consultant. At the moment I have the email event set which works but send a email to everyone; $email="everyone@test.com"; $from="admin@test.com"; $msg=""; $subject="New ToDo item"; foreach($values as $field=>$value) { if(!IsBinaryType(GetFieldType($field))) $msg.= $field." : ".$value."\r\n"; } $ret=runner_mail(array('to' => $email, 'subject' => $subject, 'htmlbody' => $msg, 'from'=>$from)); if(!$ret["mailed"]) echo $ret["message"];
|
A
|
ant author 2/17/2012 |
Hi Brian |
C
|
copper21 2/17/2012 |
The only thing that i can think of is try putting back tick marks on the table name in the query: |
A
|
ant author 2/18/2012 |
Hi Brian |
C
|
copper21 2/18/2012 |
Glad to hear you finally got it working...it took me a bit to get that one too! |