sendika kullanarak mysql sorgularında sorun

0 Cevap php

hello i was looking for a way to combine different mysql queries in a php file so this is my code :

 $sql_query = "SELECT b.*, 
u.username AS MY_Sender
  FROM table_users u, 
       table_blogs b  
 WHERE b.reciever = '0'  
   AND 
   u.user_id = b.sender  

UNION  

SELECT b.*,
u2.username AS MY_Recipient
  FROM table_users u2, 
       table_blogs b  
 WHERE b.reciever != '0'  
  AND 
  u2.user_id = b.reciever  
";

Bu MY_Recipient getir olamaz sürece bu kod çalışıyor

Yukarıdaki kod i blog yazısı gönderen ve alıcı hem de almak gerekir

bunu yapmak için Birliği'ni kullanmak yanlış mı!

0 Cevap