Datetime en Francais / PHP/MYSQL

Fermé
damiens75 - 31 oct. 2007 à 23:01
 adan - 30 janv. 2008 à 10:47
Bonjour tout le monde, je suis en pleine galere depuis quelques semaine,
j'ai dans ma base de donnée un champ date de type datetime
j'aimerais l'inverser en francais, voici ma source php,

Merci à tous ceux qui souhaitent m'aider


<?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é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://fpdownload2.macromedia.com/get/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="https://get.adobe.com/flashplayer/" />
</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 />




';
}
?>
A voir également:

6 réponses

lami20j Messages postés 21331 Date d'inscription jeudi 4 novembre 2004 Statut Modérateur, Contributeur sécurité Dernière intervention 30 octobre 2019 3 569
1 nov. 2007 à 21:07
Salut,

ici tu as la solution formater date mysql
2
CH4NCE Messages postés 620 Date d'inscription jeudi 7 décembre 2006 Statut Membre Dernière intervention 8 août 2013 725
31 oct. 2007 à 23:48
kikou.
elle est imprimée sous quelle forme ta date ?
0
Oups, j'avais pas eu ta réponse,

J'ai essayer en DATE, marche pas
et la, c en DATETIME mais c pareil

Merci de ton aide
0
anthony2009 Messages postés 3 Date d'inscription jeudi 1 novembre 2007 Statut Membre Dernière intervention 1 novembre 2007
1 nov. 2007 à 01:54
Je doit imperativement rendre ce site pour demain, je bosse comme un fou, c vraiment crevant de toujour chercher, ralala
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
CH4NCE Messages postés 620 Date d'inscription jeudi 7 décembre 2006 Statut Membre Dernière intervention 8 août 2013 725
1 nov. 2007 à 18:19
Bon tu veux pas répondre à ma question :s

D'apres ce que j'ai compris la date est enregistrée ds ta bdr mais pas sous la bonne forme.
Peut-etre qu'utiliser un "explode" serait une solution.
Tu "explode" et tu remets en forme.
A+
0
Excusez moi,j'ai une question!!
j'ai un fichier de données que je veux importer dans ma BD Mysql, j'arrive jusque là à importer tous les autres champs d'une de mes tables sauf le champ date qui est de type datetime
je voudrais arriver à afficher la date dans le format jjmmaaaa. j'ai un script PHP d'import et je pense qu'il me faudrait une fonction qui fasse la conversion avant l'import.
aidez moi!
0