algo asi.
Código PHP:
mysql_query("select ips.idips,ips.nombre,ipsmed.idmed from tbusuarios,tb_ips_med as ipsmed,tb_ips as ips where login = [B]?>" + d.f_log.value + "[/B]<? and tipo = '1' and ipsmed.idmed = '8326' and ipsmed.idips = ips.idips ");