title: CURDATE() does not work for SQL Server what can I use in replace
body: <p>I have a simple issue I am using PDO with SQL Server I had <code>CURDATE()</code> before but that didn't work because SQL Server does not support that. Only MySQL does and I added <code>GETDATE()</code> but that is not working also. How would I be able to get the current date. I want the information to show first name order by id and todays date only.</p>
  <pre><code>$stmt = $db-&gt;prepare(&quot;SELECT * FROM students WHERE name='Firstname' And Getdate() ORDER BY id DESC&quot;);
  $stmt-&gt;execute()
  </code></pre>
  <p>This is what I meant</p>
  <pre><code> $stmt = $db-&gt;prepare(&quot;SELECT * FROM students WHERE name='BOB' And Getdate() ORDER BY id DESC&quot;);
   $stmt-&gt;execute()
  </code></pre>
  <p>The whole query page.</p>
  <pre><code>&lt;!DOCTYPE&gt; 
      &lt;html&gt;
      
      &lt;head&gt;
      
      &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;?php
      //connects to the database
      require_once(&quot;../../db_connect.php&quot;);
      
      //prepared statement with PDO to query the database
      $stmt = $db-&gt;prepare(&quot;SELECT * FROM requests WHERE name='Bob' AND Date = CAST(GETDATE() AS DATE) ORDER BY id DESC&quot;);
      $stmt-&gt;execute();
      
      ?&gt;
      
      &lt;?php //start of the while loop ?&gt;
      &lt;?php while( $row = $stmt-&gt;fetch(PDO::FETCH_ASSOC) ) { ?&gt;
      
   &lt;table border=&quot;1&quot;&gt;
      
      &lt;br&gt;
      &lt;tr&gt; 
          &lt;th style=&quot;width:25px; height: 25px;&quot;&gt;ID&lt;/th&gt;
          &lt;th style=&quot;width:90px; height: 25px;&quot;&gt;Name&lt;/th&gt;
          &lt;th style=&quot;width:40px; height: 25px;&quot;&gt;Date&lt;/th&gt;
     
      &lt;/tr&gt;
      &lt;tr style=&quot;width:25px&quot;&gt;
      &lt;?php $id = $row['id'];?&gt;
      &lt;?php echo  &quot;&lt;td&gt; &lt;a href='../../update.php?id=$id'&gt;$id&lt;/a&gt;&lt;/td&gt;&quot;?&gt;
          &lt;td style=&quot;width:90px; height: 12px;&quot;&gt;&lt;?php echo $row['name']; ?&gt;&lt;/td&gt;
          &lt;td style=&quot;width:40px; height: 12px;&quot;&gt;&lt;?php echo $row['date']; ?&gt;&lt;/td&gt;
    
      &lt;/tr&gt;
       
      &lt;/table&gt;
      
        &lt;?php } //end of the while loop?&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>Here is the page were user updates the information</p>
  <pre><code>&lt;?php
      include('db_connect.php');
      $id=$_GET['id'];
      $result = $db-&gt;prepare(&quot;SELECT * FROM students WHERE id= :id&quot;);
      $result-&gt;bindParam(':id', $id);
      $result-&gt;execute();
      for($i=0; $row = $result-&gt;fetch(); $i++){
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  
  
  &lt;/head&gt;
  &lt;body class='body'&gt;
  &lt;form action = &quot;update_process.php&quot;  method =&quot;post&quot; class=&quot;Form&quot;&gt;
          
  &lt;p&gt;&lt;input type =&quot;hidden&quot; name = &quot;id&quot; value=&quot;&lt;?php print($id); ?&gt;&quot;&lt;/p&gt;
  
  &lt;table border='1' align=&quot;center&quot;&gt;
  &lt;tr&gt;    
      &lt;td&gt;Name:&lt;/td&gt;
  &lt;td&gt;&lt;input type=&quot;text&quot; value =&quot;&lt;?php  print($row['name']) ?&gt;&quot;name=&quot;name&quot;&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;    
      &lt;td&gt;Date&lt;/td&gt;
  &lt;td style=&quot;width: 303px&quot;&gt;
  &lt;input type=&quot;text&quot; value =&quot;&lt;?php echo date(&quot;Y-m-d&quot;,time())?&gt;&quot;name=&quot;date&quot; style=&quot;width: 148px&quot;&gt;&lt;/td&gt;
  
  
  &lt;/tr&gt;
  
  &lt;/table&gt;
      
  &lt;input type=&quot;submit&quot; value= &quot;Update Information&quot;&gt;
  &lt;br&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php
      }
  ?&gt;
  </code></pre>