title: php connection to mysql replication
body: <p>I have set up a slave server for my master and i want to know if i need to connect to both servers via php or is the load balanced just connecting to the master?</p>
  
  <pre><code>//slave
  $c2 = mysql_connect("10.100.27.10","&lt;user&gt;","&lt;pass&gt;")or die(mysql_error());
  
  //master
  $c =mysql_connect("10.100.27.99","&lt;user&gt;","&lt;pass&gt;")or die(mysql_error());
  
  mysql_select_db("piksearch", $c2);
  mysql_select_db("piksearch");
  </code></pre>