title: sql select FROM_UNIXTIME(unix_timestamp) engine independent
body: <p>I need to convert INT to DATETIME, on SQL Server it would be:</p>
  
  <pre><code>select cast(convert(unix_timestamp,103) AS datetime)
  </code></pre>
  
  <p>on MySQL the syntax is:</p>
  
  <pre><code>select FROM_UNIXTIME(unix_timestamp)
  </code></pre>
  
  <p>But i need to make it engine independent(SQL Server, MySQL, T-sql and so on).
  is it possible?</p>
  
  <p>Maybe its possible to trick it in PHP?</p>
  
  <pre><code>&lt;?php
  $sql='select cast(convert(1350134926,103) AS datetime)';
  $result = @mysql_query($sql);
  
  if(!$result){
    $sql=' select FROM_UNIXTIME(1350134926)';
    $result = @mysql_query($sql);
  
    if(!$result){...}
  
  }
  
  ?&gt;
  </code></pre>