Problems calling the same server-side field

Problems calling the same server-side field

tumbero_xtumbero_x Posts: 63Questions: 0Answers: 0
edited July 2012 in General
Hello friends!
my problem is I need to call a field from a different table with different ID
I'm doing well but I get this result, however if I do the same query from the mysql works perfect
[code]if(!empty($_GET['usu_id']))
{
$donde=' AND C.correo_des="'.$_GET['usu_id'].'" ';
$tambien='';
$aColumns= array(
'correo_id',
'nombre_usuario',
'correo_asunto',
'DATE_FORMAT(correo_fecha,"%d/%m/%Y")',
'correo_hora',
'IF(correo_status=0,"NO","SI")'
);
}
else{
$donde='';
$tambien=' INNER JOIN usuarios M ON C.correo_des = M.usuario_id';
$aColumns= array(
'correo_id',
'A.nombre_usuario',
'M.nombre_usuario',
'correo_asunto',
'DATE_FORMAT(correo_fecha,"%d/%m/%Y")',
'correo_hora',
'IF(correo_status=0,"NO","SI")'
);
} [/code]
[code]$sQuery = "
SELECT SQL_CALC_FOUND_ROWS " . str_replace(" , ", " ", implode(",", $aColumns)) . "
FROM $sTable C
INNER JOIN usuarios A ON C.correo_rem = A.usuario_id $donde $tambien
$sWhere
$sOrder
$sLimit
";[/code]
//out
{"sEcho":0,"iTotalRecords":"1","iTotalDisplayRecords":"1","aaData":[["1",null,null,"hola que tal","10\/07\/2012","10:37:28","NO"]]}

the field 'A.nombre_usuario' and 'M.nombre_usuario' null out
thanks for any help you can give me
regards
This discussion has been closed.