I have several tables in mysql which are connected by a relation. Each has its own unique id and data. Only when trying to query them I get a strange result:
(use print_r)
Array ( [0] => Array ( [id] => 1
[0] => 1
[tbl2_id] => 1
[1] => 1
[tbl3_id] => 1
[2] => 1
[3] => 1
[name] => name1
[4] => name1
[surname] => ...
)
)
I do not want the 0 and so on.
Just for example, it should look like this:
(use print_r)
Array ( [0] => Array ( [id] => 1
[tbl1_id] => 1
[tbl2_id] => 1
[tbl2_tbl1id] => 1
[tbl3_id] => 1
[tbl2_tbl1id] => 1 ...
)
)
or something similar. I use PDO and when it invokes sql looks something like this:
SELECT *
FROM `tbl`
INNER JOIN (tbl2, tbll)
ON tbl.tbl1_id=tbl1.id
AND tbl.tbl2_id=tbl2.id
WHERE 1
after using it in mysql gets such an effect as in the picture(Run SQL query/queries on databas)