Answer the question
In order to leave comments, you need to log in
How to join tables by column name?
To generate the form, I needed to create an SQL query that would return a similar result to me:
I think I need to start the query with:
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'MYTABLENAME';
SELECT * FROM `MYTABLENAME` WHERE id = 'MYID';
Answer the question
In order to leave comments, you need to log in
Manually.
Store the result of the first query in an array of field descriptors.
Get from `MYTABLENAME` an associative array of values like
['id' => ..., 'name' => ..., type => ..., 'displacement' => ..., 'construction_date' => . ..].
You go through the array of field descriptors, for each field you take the corresponding result from the array of values and output it according to the type.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question