title: how to use CURL to request a php page on another server and then process the response
body: <p>I'm trying to connect to a mysql db, but from another server and process all queries on that server and then send all the data off to the original server, using CURL.</p>
  
  <p>I've been researching for hours and cant seem to find the right way to go about it.</p>
  
  <p>so this is what I'm trying to do overall:</p>
  
  <ol>
  <li><p>When somebody visits a page from server A, a request will then be sent out from server A to server B which will then connect to a db.</p></li>
  <li><p>Once server B has connected to the db, it will take information from certain rows and fields and then send it back to server a.</p></li>
  <li><p>Once server A has received the info, it will then echo out and etc etc...</p></li>
  </ol>
  
  <p>Firstly, is this safe to do? It wont like open a door on both or even one server will it?</p>
  
  <p>Secondly, I have no idea how to go about it.</p>
  
  <p>An example code would be great!</p>