+3  A: 

you have multiple columns that call "name"

in your select , add to the list of fields :

cdkb.name as name1 ,dkb.name as name2 ....

and then echo $row['name1'] ...

Haim Evgi
The aliases need to be use inside the query or just in the php code as you have it?for example dkb.id as id1LEFT OUTER JOIN dkb ON ( cart.id = id1 AND id1 = '".$ids."' )
jona
The aliases have to be in the query. When you use the same field name in multiple tables in a query, and retrieve them using mysql_fetch_array(), you have to make sure that all those field names are unique, because they'll be used as the array keys in PHP. e.g. `Select table1.name, table2.name, table3.name...` will turn into `$row['name']` only. But if you do `select table1.name as firstname, table2.name.secondname, table3.thirdname...` will become `$row['firstname']`, `$row['secondname']`, etc...
Marc B
What about if you have many fields on those three tables that you won't necessarily use in that query and code do you have to specify it any ways at the query?
jona
Thank you Marc B i got that explanation still the error whenever I test the query like on phpmyadmin. There is an error that goes like.#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM cart LEFT OUTER JOIN dkb ON (cart.id = dkb.id' at line 21
jona
A: 

Using more than one star in SELECT-query - bad practice. You can get conflict with column names and your code can become erroneous.

Adelf