title: Selecting TimeStamp difference with INNER JOIN
body: <p>I want to select the fields that satisfy a timestamp difference condition between the &quot;datetime&quot; columns in two tables. I use the INNER JOIN procedure. In the ON condition I feel neccessary to convert the &quot;datetime&quot; data in timestamp using strtotime function as follows:</p>
  <pre><code>$Seuil = 120;
  $stm = $dbco-&gt;prepare
  (&quot;SELECT picbruit.Id_B, survols.Id_S 
  FROM picbruit
  INNER JOIN survols
  ON (strtotime(survols.date_S) - strtotime(picbruit.date_B)) &lt; :sl&quot;);
  $stm-&gt;execute([':sl'=&gt;$Seuil]);
  </code></pre>
  <p>I received the following message (note that valpic is the name of the database):
  Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION valpic.strtotime does not exist in C:\wamp64\www\formationwamp\Correle_PS.php on line 24</p>
  <p>What would be the appropriate syntax to circumvent this issue?</p>