<?php
 $queryExImage = "SELECT id,YEAR(dateOriginale) FROM image WHERE nom ='$file' AND codeTheme ='$codeTheme' AND prive='$accessPrive'"; $resultExImage = mysql_query ($queryExImage) or die ("La requête de test a échoué"); $lineExImage = mysql_fetch_row($resultExImage); /* Free resultset */ mysql_free_result($resultExImage);  if ($lineExImage[0]==null)	{  $queryInsertImage = "INSERT INTO image (`nom`,`codeTheme`,`prive`,`dateOriginale`,`bestof`) VALUES ('$file','$codeTheme','$accessPrive','$dateTimeOriginale','0')";  $resultInsertImage = mysql_query ($queryInsertImage) or die ("La requête d'insertion de l'image a échoué"); }else if ($lineExImage[1]<10) {  $queryExImage = "UPDATE image set dateOriginale='".$dateTimeOriginale."' WHERE nom ='$file' AND codeTheme ='$codeTheme' AND prive='$accessPrive';"; $resultExImage = mysql_query ($queryExImage) or die ("La requête de maj date a échoué"); } ?> 