Considering I am using PHP and MySql, I have 2 table in my database named: table A and table B. I use a php page to populate both of them, and another php page for diplay them. Table A contains for each row a clickable button that open a modal pop-up. What I would like to do is show in this modal some info from table B for the respective row.
This is what I mean:
- button of row1 table A shows info of row1 table B
- button of row2 table A shows info of row2 table B
I am stuck to the point where each button in table A show me the entire the table B, and I cannot figure out how to relate this rows. Any tips?
I dont understand how can I associate for each button of the row a different "action".
---- additional info: ----
- The index.php page diplays table B
- Every time a new row is inserted, a button gets created.
- Every time i click on the button, a modal shows the referred row of table A.
----- UPDATE 2 ------ Table B can be cosider an extension of table A
Table A has this column:
id | name | mail | number | device | price | payment | status
Table B has this column:
id | device | model | problem | status | priority | BUTTON1 | BUTTON2
button1 -> change the status and the change is reflected in table A
button2 -> should gather the respecive row of table A with the information name | mail | number | price | payment
----- UPDATE 3 ------
In table B:
$custid = $row['id'];
<td> <a class='btn btn-primary btn-sm' data-toggle='modal'
data-target='#myModal' name='[$custid]' > Info</a></td>
In table A:
$sql = "SELECT name,mail,number,price,paymenttype,faktura,date from TABLE_A";