add/save records into two tables

I have two tables student and SMS
i want add records in students and some fields in SMS table. I think i can only one table on a page for adding records. how 2nd table will work
how this work.
thanks

You may use Row_Updated/Inserted server event to execute UPDATE/INSERT statement for the other table.

can you explain me more with example… I have no more knowledge in php.
e.gI have table ‘student’ . field is code, name,moble it is inserting table ‘complaints’ with phpmaker auto codes. but these same fields ‘require’ in outbox table. thanks in advance
please make example for me.

For example, simply put this following code into Row_Inserting server event that belongs to the student table:

ExecuteStatement("INSERT INTO sms(Field1, Field2, Field3) VALUES('1', '2', '3')");

Adjust the field names and the values that suits your needs. If you want to change one/some values above with the values from existing field in your student table, then you may simply use, for example: $rsnew[“student_id”] (assume student_id in student table is an integer field type):

ExecuteStatement("INSERT INTO sms(Field1, Field2, Field3) VALUES(" . $rsnew["student_id"] . ", '2', '3')");

Please note, Row_Inserting should be Row_Inserted.

I put like this

// Row Inserted event
function Row_Inserted($rsold, &$rsnew)
{
   ExecuteStatement("INSERT INTO outboxwhatsapp(phone, name, message) VALUES('1', '2', '3')");
}

but errorAn internal error has occurred while processing your request.

You may enable Debug and check HTTP response to see the error in more detail.

[2022-10-24T14:15:57.884251+00:00] log.DEBUG: Slim Application Error Type: Doctrine\DBAL\Exception\InvalidFieldNameException Code: 1054 Message: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘name’ in ‘field list’; File: C:\xampp\htdocs\portal\vendor\doctrine\dbal\src\Driver\API\MySQL\ExceptionConverter.php Line: 67

ufone wrote:

column ‘name’ in ‘field list’

As the error message said.

thanks: my first custom record in save with your help.

Now i want to add record from (form) CvCsvAdd like this.

ExecuteStatement("INSERT INTO outboxwhatsapp(sname, message, mobile) VALUES (" . $rsnew["name"] . ", '2', '3')");

How value write… VALUES (" . $rsnew[“name”] . “, ‘your are in 8th grade’, ‘32666666’)”);but error[2022-10-24T17:31:31.956301+00:00] log.DEBUG: Slim Application Error Type: Doctrine\DBAL\Exception\SyntaxErrorException Code: 1064 Message: An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ’ ‘2’, ‘3’)'; at line 1

Try:ExecuteStatement(“INSERT INTO outboxwhatsapp(sname, message, mobile) VALUES ('” . $rsnew[“name”] . “', ‘2’, ‘3’)”);

this not working…
can i explain my need again?i am inserting records from this above form… in table CvCSVi want same records in other table ‘outbox’
records are name,phone1
thanks

You better post your tables schema (CREATE TABLE …) for more discussion.