I have a database in which the master holds overall information regarding a project.
The detail table is used to track the progress of the project. Each time a detail reord is added it is assigned to another department/individual for processing.
In the detail record I have a field 'Assign_to'. I want to get the value in this field and update the 'Assigned_to' field in the master record.
The master record table is 'Project' and the Detail table is 'Progress'
When entering a new Progress record in After Record Added I have tried using:
$sql = "INSERT INTO Project (Assigned_to) values $values[Assign_to]";
CustomQuery($sql);
Syntax checks OK but when I run the application I get the error below.
Does anyone have any sugestions please?
Ian
php error happened
Technical information
Error type 256
Error description You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Ian Thomas' at line 1
URL localhost/Progress_add.php?submit=1&fly=1&
Error file C:\Users\owner\Documents\PHPRunnerProjects\LLD_Tracker_build30v911v97\output\connections\Connection.php
Error line 661
SQL query INSERT INTO Project (Assigned_to) values Ian Thomas
More info
Call stack
File: line Function Arguments
0. connections\Connection.php:661 trigger_error 1. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Ian Thomas' at line 1;
- 256;
1. connections\Connection.php:661 Connection->triggerError 1. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Ian Thomas' at line 1;
2. connections\MySQLiConnection.php:142 MySQLiConnection->query 1. INSERT INTO Project (Assigned_to) values Ian Thomas;
3. include\dal.php:24 CustomQuery 1. INSERT INTO Project (Assigned_to) values Ian Thomas;
4. include\Progress_events.php:39 eventclass_Progress->AfterAdd 1. Array ( [Project_Ref] => Array [ID] => Array [Hotel] => Array [Assign_to] => Array [Email] => Array [Assign_for] => Array [Assign_Date] => Array [Required_by] => Array ...;
- Array ( [PID] => Array ) ;
- ;
- AddPage;
5. classes\addpage.php:670 AddPage->callAfterAddEvent N/A
6. classes\addpage.php:418 AddPage->processDataInput N/A
7. classes\addpage.php:301 AddPage->process N/A
8. Progress_add.php:282 Global scope N/A