This topic is locked

Writing fields from one table to another table in After Add Event

11/23/2016 2:27:15 PM
PHPRunner General questions
L
LandonH author

I am trying to writing fields from one table to another table in After Add Event.

I have used the event widget but keep getting errors.

Here is the code.
/*
//** Insert a record into another table ****
$sql = "INSERT INTO dbo.0682_work_log (uniqueid, Incident_Log) values ('r_id', 'Knowledge_Base')";

CustomQuery($sql);
*/
The Error:
Technical information

Error type 256

Error description Source: Microsoft SQL Server Native Client 11.0

Description: Incorrect syntax near '.0682'.

URL dmmmaxrep/20x_lcam/apps/dept0682/0682stm/dbo_0682_stm_main_add.php?submit=1&

Error file D:\xampp\xampp\htdocs\20x_lcam\apps\Dept0682\0682stm\connections\MSSQLWinConnection.php

Error line 132

SQL query INSERT INTO dbo.0682_work_log (uniqueid, Incident_Log) values ('r_id', 'Knowledge_Base')
All help is appreciated.
Landon

Sergey Kornilov admin 11/24/2016

Try your query this way:

INSERT INTO [0682_work_log] (uniqueid, Incident_Log) values ('r_id', 'Knowledge_Base')