title: Parse error: syntax error, unexpected 'createFromFormat' (T_STRING), expecting variable (T_VARIABLE) or '$' in
body: <p>This is about room reservation site. I need to save the reservation dates in few rows by increase one day until the days i want to reserve. I'm new to php so i'm very thanksful to anyone who can simply explain me the problm. Here is the code.</p>
  
  <pre><code>$today=date("Y/m/d");
  $date = new DateTime::createFromFormat("l dS F Y", $in);
  
  $con = mysql_connect("localhost","root");
  if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("royal", $con);
  {echo $i."&lt;br&gt;";
  for ($y=1; $norooms&gt;=$y; $y++)
      {
      echo "Day difference=".$len." No of rooms=".$norooms."&lt;br&gt;";
      $date = $date-&gt;format('d/m/Y');
      $sql="INSERT INTO singlerooms (Date,Ref_Date)VALUES ($date,$today)";
      mysql_query($sql,$con);
      }
  }
  </code></pre>