1

I have a php code that use a mySQL query in it. tables users and conversation and main_profile have true values to select after this query but query return nothing.

$sqlQuer = 
"SELECT `conversation`.from,`conversation`.text, `main_profile`.nik_name, `users`.id  
FROM `conversation` 
INNER JOIN `users` ON(`users`.username = `conversation`.to ) 
INNER JOIN `main_profile` ON(`users`.id = `main_profile`.user_id) 
WHERE `conversation`.to = '".$to."' 
AND `conversation`.read = '0'";

$result = mysql_query( $sqlQuer) or die (mysql_error());
while($row = mysql_fetch_array($result))
{
    echo $row[0] . "#TEXT#" . $row[1]. "#TEXT#" . $row[2] . "#CON#";
    $ids[] = $row['id'];
}

any Idea ?

1 Answers1

1

Query was solved with this change that First INNER JOIN changed to LEFT JOIN and second changed to RIGHT JOIN.