title: Connetions with another database and server on subquery
body: <p>How can I connect with <code>db1</code>, <code>server1</code> with <code>sub query</code> ?
  Thanks!</p>
  
  <pre><code>$link1 = mysql_connect("server1","user1","pas1");
  mysql_select_db('db1', $link1);
  $link2 = mysql_connect("server2","user2","pas2") or die(mysql_error());
  mysql_select_db("db2", $link2) or die(mysql_error());
  
  $sql="SELECT db2.`e`.`entity_id` , db2.a.value AS klantnr, db2.b.value AS    voornaam,db2.c.value AS achternaam, db2.`t`.`value` AS telfnr, db2.ce.email FROM     db2.`tablename` e LEFT OUTER JOIN db2.customer_entity_varchar a ON db2.a.entity_id = db2.e.parent_id AND db2.a.attribute_id = '133' WHERE db2.ce.email NOT IN(SELECT db1.email_addresses.email_address FROM db1.tablename) AND db2.a.value IN (SELECT db1.accounts_cstm.custid_c FROM db1.accounts_cstm ) GROUP BY db2.ce.email";
  $result = mysql_query($sql,????) or die(mysql_error());
  </code></pre>
  
  <p>I have another solution (way) but I get this error(Operand should contain 1 column(s))</p>
  
  <pre><code>$link1 =mysql_connect("server1","user1","pas1");
  mysql_select_db('db1', $link1);
  $link2 = mysql_connect("server2","user2","pas2") or die(mysql_error());
  mysql_select_db("db2", $link2) or die(mysql_error());
  $query="SELECT email_addresses.email_address FROM db1.tablename";
  $result = mysql_query($query,$link1) or die(mysql_error()); 
  $select=array();
  $row=mysql_fetch_array($result);
  $select[]=$row["email_address"];
  $select = "('" . implode ("','", $select) . "')";
  mysql_query("set     sql_big_selects=1",$moonen_link); 
  $sql="SELECT `e`.`entity_id` , a.value AS klantnr, b.value AS voornaam, c.value AS achternaam, `t`.`value` AS telfnr, ce.email FROM `tablename` e LEFT OUTER JOIN customer_entity_varchar a ON a.entity_id = e.parent_id AND a.attribute_id = '133' WHERE ce.email NOT IN($select) GROUP BY ce.email"; $result = mysql_query($sql,$link2) or die(mysql_error());
  </code></pre>