title: Insert Data into MSSQL DB using PHP
body: <p>Hello there am trying to insert data into MSSQL using PHP. I have tried many times to figure out what the problem might be but i seem not to find it. Is there something am not getting right or missing?</p>
  
  <pre><code> &lt;?php
  //pull form fields into php variables
  $no = $_POST['no'];
  $name= $_POST['name'];
  $date = $_POST['date'];
  $leave = $_POST['leave'];
  $days= $_POST['days'];
  $empno= $_POST['empno'];
  
  //connect to sql
  $dbc = mssql_connect('Server-PC','user','password','database')or die('Error connecting to
        the   SQL Server database.');
  
   // Input into staff database
    $query = "INSERT INTO dbo.[CAGD$Leave Plan] ([No_],[Employee No_],[Employee Name],
   [Leave Name],   [Start Date],[Leave Days],Satus) VALUES   
  ('$no','$name','$leave','$date','days','empno')";
  $r esult = mssql_query($query,$dbc)or die('Error querying MSSQL database');
  
  //close to sql
  mssql_close($dbc);
  
  echo $name . 'Your submission has been received&lt;br /&gt;';
  echo 'If you need change this request please contact your HR Manager&lt;br /&gt;';
  echo 'Thank you &lt;br /&gt;';
  echo 'HR Manager';
  ?&gt;
  </code></pre>
  
  <p>I get this error message:
      Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'dbo.CAGD Plan'.<br>
      (severity 16) in C:\xampp\htdocs\CAGD\leave_request.php on line 110</p>
  
  <pre><code>Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs  
  \CAGD\leave_request.php on line 110
  Error querying MSSQL database
  </code></pre>