IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Champ Datetime en Francais [MySQL]


Sujet :

PHP & Base de données

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2007
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2007
    Messages : 2
    Par défaut Champ Datetime en Francais
    Bonjour,
    Je cherche depuis plusieurs jours pour afficher mon champ date de mysql en France, ce champ est de type datetime.

    Quelqu'un connait-il une solution ?


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    <?php
    $total=0;
    $parpage=5;
    if(isset($_GET['page']))
    			$page=$_GET['page'];
    			else
    			$page=0;
     
    if(isset($_GET[catpodcasts])){
     
    			$cat=$_GET[catpodcasts]; //LORSQU IL A UNE CATEGORIE
    			$commaff= mysql_query("SELECT * FROM ".T_PODCAST." WHERE idcat='$cat' ORDER BY id DESC LIMIT $page,$parpage ");
    			$totalid=mysql_query("SELECT * from ".T_PODCAST." WHERE idcat='$cat'");
     
    			}else{
    		$commaff= mysql_query("SELECT * FROM ".T_PODCAST." ORDER BY date desc LIMIT $page,$parpage");
    		$totalid=mysql_query("SELECT * from ".T_PODCAST."");
     
    		}
    				while ($donnees = mysql_fetch_array($totalid))
    	{
    		$total++;
    	}
     
    			$repon = mysql_num_rows($commaff);
    if(!$repon) {
    echo'<div align="center">Aucun podcast dans cette cat&eacute;gorie</div>';
    }	
     
    		while ($donnees = mysql_fetch_array($commaff))
    			{
    			$max=200;
    			$chaine=$donnees['description'];
    			if(strlen($chaine)>=$max)
    			{
    				$chaine=substr($chaine,0,$max); 
    				$espace=strrpos($chaine," "); 
    			if($espace)
    				$chaine=substr($chaine,0,$espace);
    				$chaine .= ' ...';
    			}		
    			$numero=$donnees[0]+102;
    							echo'<table id="Tableau_01" width="719" height="126" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td>
    			<img src="images/podcastsaudioradio_01.png" width="719" height="12" alt=""></td>
    	</tr>
    	<tr>
    		<td valign="top"><table width="719" height="102" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td background="images/podcastsaudioradio_02.png"><div align="center">
                  <table width="97%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="14%" valign="top"><table width="70" height="70" border="0" cellpadding="5" cellspacing="0">
                          <tr>
                            <td valign="middle" ><div ><span ><img src="podcast/images/'.$donnees['image'].'" width="80" height="80" border="0" class="glossy iradius""></span></div></td>
                          </tr>
                      </table></td>
                      <td width="59%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
                        <tr>
                          <td><div align="justify">
                              <div align="justify" ><strong>'.stripslashes ($donnees['titre']).'</strong> - <strong>'.$donnees['date'].'</strong></div>
                             '.stripslashes ($chaine).' <strong><a href="biographie.php?numero='.$numero.'"><br/>
                          </a></strong><a href="biographie.php?numero='.$numero.'"></a></div></td>
                          </tr>
                      </table></td>
                      <td width="27%" valign="middle"><div align="right">
    				  
    				  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="150" height="50"
        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
        <param name="movie" value="mp3-player/singlemp3player.swf?file=podcast/audio/'.$donnees['mp3'].'&autoStart=false&backColor=ffffff&frontColor=700b21&songVolume=100" />
        <param name="wmode" value="transparent" />
        <embed wmode="transparent" width="150" height="50" src="mp3-player/singlemp3player.swf?file=podcast/audio/'.$donnees['mp3'].'&autoStart=false&backColor=ffffff&frontColor=700b21&songVolume=100"
        type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    				  </div></td>
                    </tr>
                              </table>
                  </div></td>
              </tr>
            </table></td>
    	</tr>
    	<tr>
    		<td>
    			<img src="images/podcastsaudioradio_03.png" width="719" height="12" alt=""></td>
    	</tr>
    </table><br />';
    }
    ?>

  2. #2
    Membre expérimenté

    Profil pro
    Inscrit en
    Juin 2002
    Messages
    6 152
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 6 152
    Par défaut
    Citation Envoyé par anthony2009
    Je cherche depuis plusieurs jours pour afficher mon champ date de mysql en France, ce champ est de type datetime.
    Qu'entendez-vous par là ? Si c'est le format qui vous gêne vous pouvez l'obtenir différemment via la fonction MySQL DATE_FORMAT lors de votre SELECT directement :
    Code SQL : Sélectionner tout - Visualiser dans une fenêtre à part
    SELECT *, DATE_FORMAT(mon_champ_datetime, '%d/%m/%Y %H:%i:%s') AS datetime_fr FROM ma_table


    (Pourquoi nous avoir donné tout votre code ?)

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2007
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2007
    Messages : 2
    Par défaut super, ca marche
    Je te remerci, tout beigne maintenant

    Meci de ton aide

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Recuperer la date sans l'heur dans un champ datetime
    Par bob33 dans le forum MS SQL Server
    Réponses: 7
    Dernier message: 22/06/2010, 12h59
  2. Réponses: 3
    Dernier message: 10/08/2005, 11h11
  3. Inserer une valeur NULL dans un champ datetime
    Par Karibou dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 10/08/2005, 10h58
  4. [VB.Net] Formatage d'un champ DateTime d'un DataGrid
    Par Jerem76 dans le forum ASP.NET
    Réponses: 10
    Dernier message: 29/07/2005, 09h44
  5. Réponses: 3
    Dernier message: 23/09/2003, 09h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo