I have 2 tables
Students & StudentsLog
When New Record is added to Students Table I like to insert the value of Student_Status, Student_Name to Students_Log
Here’s what I did
// Row Inserted event
function Row_Inserted($rsold, &$rsnew) {
//echo "Row Inserted"
$Student_Status = $rsnew["Student_Status"];
$Student_Name = $rsnew["Student_Name"];
$MyResult = ew_Execute("INSERT INTO studentslog (Student_Status, Student_Name) VALUES ( $Student_Status, $Student_Name)");
}
I’m getting error
Case 1: If I type the Student name: FrankLee no space between First & Last Name
Failed to execute SQL. Error: You have an error in your SQL syntax; check the manual that corresponds Failed to execute SQL. Error: Unknown column 'FrankLee' in 'field list'
Case 2: If I type the Student name: Frank Lee with space between First & Last Name
Failed to execute SQL. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Lee)' at line 1
FrankLee or Lee is the student name not a field
Can someone Help me please
Thank you for your help & time