php关键错误

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)

http://i.stack.imgur.com/FSCs0.png

This looks like you are using PDOStatement::fetch() with fetch_style set to PDO::FETCH_BOTH - which is default.

http://php.net/manual/en/pdostatement.fetch.php

use PDO::FETCH_ASSOC as the fetch_style, and you should get what you are looking for.

$result = $sth->fetch(PDO::FETCH_ASSOC);
print_r($result);