I'm busy setting up a simple incident logger for a client. The idea is that they can log a incident and on save it emails the client. I have two tables setup up. One for the incidents and one for the clients. The problem is I'm not able to pull the email address from the client table on the php. Here is my Table structure:
Table 1: ipcamclient
ipcamclient_id
ipcamclient_name
ipcamclient_company
ipcamclient_email
Table 2: ipcam_incidents
ipcam_incidents_id
ipcamincident_num
ipcamincident_date
ipcamincident_hour
ipcamincident_client - This is a lookup on the client table, which gives me the unique ID from ipcamclient_id Which I have manually changed to the client email address via phpmyadmin.
ipcamincident_report
My Email script is:
Code: Select all
$to = "#ipcamincident_client#";
$from = "alerts@**.com";
$fromname = "IPCameraSolutions Alerts";
$content = "Incident details\n
Client:#ipcamincident_client#\n
Date:#ipcamincident_date#\n
Time:#ipcamincident_hour#\n
Incident:\n
#ipcamincident_report#\n";
$subject = "New Incident reported";
$html = false;
$sm = nuSendEmail($to, $from, $fromname, $content, $subject, $html);
Code: Select all
ipcamclient_id