G
G
Governor2018-04-21 15:45:04
MySQL
Governor, 2018-04-21 15:45:04

How to write data to two MySQL tables?

The PHP form must call the 'reader registration' procedure, on the form, 4 text fields:
full name, address, date of birth, phone numbers - separated by commas.
Everything should be stored in 2 tables:
1: reader ( ID , fullName, address, birthday)
2: readerPhones ( number , reader_ID)
First you need to send the full name, address, and date of birth to the `reader` table.
Then get their id, parse the numbers, and send them to the readerPhones table.
I can't figure out how to turn it all around. What is the best way to send numbers, as a string separated by commas and in a different form? How to parse numbers in a procedure and where if there are no arrays in SQL. In general, if it's not difficult for anyone, throw an example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TCloud, 2018-04-21
@OTCloud

Two functions and two INSERT statements. Is everything clear here?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question