Background
Hello, I am developing an experimental / educational tool in PHP and MySQL. I am new to SQL, but I want to do everything right from the start. I use prepared PDO statements for all variable substitutions and wherever possible (therefore, as far as I understand, it will not be portable for databases other than MySQL). As for my problem, I have an idea on how to move on, but it will take me several hours to implement (I am new to SQL syntax), so I thought that I would first create a question if someone could scream: "This is not the way to do it!" and save me strength.
Problem
I would like to create an interface in which the user will choose from the drop-down menus:
- table
A, - one or more fields in this table, for example.
A.xand A.y, - table
B, - one or more fields in this table, for example.
B.zand B.y,
and after presentation, the code will perform an internal join corresponding to each field, respectively, for example. A.x = B.z, A.y = B.yetc. and return all matched rows.
My plan is to generate an INNER JOINSQL statement, scroll through fields and insert placeholders ( ?), bind the appropriate parameters, and finally execute the statement.
Is there an easier way to do this? Is there a better way to do this? Will it be used in any way?
Thanks in advance. If no one answers by the time I finish (doubtful), I will post my decision.
Miscellaneous.
Suppose i check
: . ( , , , !)
, , . , "", , .