title: JQuery / PHP dynamically connect to network sql server database
body: <p>I'm totally new to this and to be honest I'm struggling to even find any basic documentation/tutorials on the subject.</p>
  
  <p>I'm using Embacadero HTML5 Builder to try and create an iphone basic app</p>
  
  <p>I have a basic form with 2 edit boxes and a button.
  All I'm trying to do is when the user clicks the button, it takes the username and password from the edits and trys to connect to a sql server (2012).</p>
  
  <p>I know the IP address of the server and the database name.</p>
  
  <p>If the connection fails due to incorrect logon, then a warning message is displayed.
  If the connection works, then it should open up the "next" page, whatever that is.</p>
  
  <p>All I have so far, which I know doesn't work is below, but you get the general gist.</p>
  
  <pre><code>function btnLoginClick($sender, $params)
  {
      $mysqlsvr = new SQLConnection('10.10.1.27', $edUsername.Text, $edPassword.Text, 'exp_main');
      $mysqlsvr.open;
  
      if fails then
          WARNING
      else
          Open new page
  }
  </code></pre>
  
  <p>I'd like to pass this database connection through if connects fine, or just store it somewhere globally for use.</p>
  
  <p>Thanks</p>