これから SELECT クエリを変更するにはどうすればよいですか。
$tre = mysql_query("SELECT System_id, Full_name FROM accounts
WHERE Full_name LIKE '". mysql_real_escape_string($_GET['q'])."%' LIMIT 5");
$tre で以下のクエリを実行するには:
SELECT DISTINCT contacts.friend_id, accounts.full_name,
accounts.system_id
FROM contacts, accounts
WHERE (contacts.system_id = '$sid' AND contacts.friend_id
= accounts.system_id) OR (contacts.friend_id = '$sid'
AND contacts.system_id = accounts.system_id)
$tre = mysql_query(); の内部に 2 番目のクエリを配置する必要があります。
2 番目のクエリには角かっこが含まれており、新しいので正しく行う方法がわからないため、そうするのに問題があります。