Why when sampling from two databases, when accessing an array, the same value is shown

$idhk = 'zhk.`zhk-id`'; $idobj = 'object.`zhk-id`'; $allroom = mysql_query("SELECT zhk.*, object.* FROM zhk LEFT JOIN object ON $idhk = $idobj "); $arrall = mysql_fetch_array($allroom); echo $arrall[0] ; echo $arrall[1] ; echo $arrall[2] ; 

Displays the same number.

The task is to combine 2 databases on zhk-id (they have the same) zhk one unique field, and object many fields with a given zhk-id

I'm doing everything right?

  • ON $ idhk = $ idobj. Do you specify "table.column"? tablA.col1 = tabl2.col2 - Daniil
  • Try to display var_dump ($ arrall). Look at the array - Ruslan Semenov
  • Yes, I specify "table.column" - No stupid questions
  • With var_dump ($ arrall); displayed an array, but for some reason there is one row of two tables, and there should be more of them - No stupid questions

0