PHP MYSQL - Affichage par date anglais

anthony2008 -  
s.spark Messages postés 2485 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,
J'ai crée un champ de date sur ma table video "mysql windows"

date en forme date

Mes article s'affichent bien dans l'ordre des dates mais la date est en anglais - 2007-05-01
j'aimerais l'avir en francais

_____________________________________
voici mon code php qui permet l'affichage

$commaff= mysql_query("SELECT * FROM ".T_VIDEOCAST." ORDER BY date DESC LIMIT $page,$parpage");
A voir également:

10 réponses

s.spark Messages postés 2485 Date d'inscription   Statut Contributeur Dernière intervention   618
 
Salut,

Mets ça :

$commaff= mysql_query("SELECT champs1, champs2, champs_etc, DATE_FORMAT(date, \'%d-%m-%Y\') AS DateTemps FROM ".T_VIDEOCAST." ORDER BY date DESC LIMIT $page,$parpage");


DateTemps contient la date dans le format voulu.
0
anthony2008
 
Merci beaucoup de ta réponse rapide, j'ai essayer mais ca ne veu rien savoir, peu etre une erreur dans ma manière d'inserer ce code ? aurais tu un bout de code complet ? avec mes champs ?

Merci de ton aide
0
s.spark Messages postés 2485 Date d'inscription   Statut Contributeur Dernière intervention   618
 
"j'ai essayer mais ca ne veu rien savoir"
C'est vague ...

"aurais tu un bout de code complet ? avec mes champs ? "
J'ai oublié ma boule de cristal.


Bien sur il faut que ton champs date soit de typte datetime.
0
anthony2008
 
Voila ma source php

merci pour ton aide

<?php

$total=0;
$parpage=10;
if(isset($_GET['page']))
$page=$_GET['page'];
else
$page=0;
if(isset($_GET['cat'])){
$cat=$_GET['cat'];
$totalid=mysql_query("SELECT * from ".T_VIDEOCAST." WHERE idcat='$cat' ORDER BY id LIMIT $page,$parpage ");


$commaff= mysql_query("SELECT * FROM ".T_VIDEOCAST." WHERE idcat='$cat' ORDER BY id LIMIT $page,$parpage ");

}else
{
$totalid=mysql_query("SELECT * from ".T_VIDEOCAST."");
$commaff= mysql_query("SELECT * FROM ".T_VIDEOCAST." ORDER BY date DESC LIMIT $page,$parpage");


}
while ($donnees = mysql_fetch_array($totalid))
{
$total++;
}
while ($donnees = mysql_fetch_array($commaff))
{
$max=150;
$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];
echo'<table id="Tableau_01" width="720" height="106" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/videosradio_01.png" width="720" height="8" alt=""></td>
</tr>
<tr>
<td><table width="720" height="88" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" background="images/videosradio_02.png"><div align="center">
<table width="98%" border="0" cellspacing="0" cellpadding="0" class="artiste">
<tr>
<td width="11%" valign="top"><table width="70" height="70" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" ><div ><a href="lecturevideos.php?numero='.$donnees['id'].'"><img src="podcast/images/'.$donnees[4].'" width="83" height="83" border="0" class="glossy iradius" margin-bottom:5px;"></a></div></td>
</tr>
</table></td>
<td width="89%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td><a href="lecturevideos.php?numero='.$donnees['id'].'"> <strong>'.stripslashes ($donnees['titre']).'</strong></a><strong> </strong>- '.$donnees['date'].'<br>
'.stripslashes ($chaine).'</td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<img src="images/videosradio_03.png" width="720" height="10" alt=""></td>
</tr>
</table><br />

';
}
?>
0

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

Posez votre question
anthony2008
 
toujour pas d'aide de personne ? aidez-moi svp je suis vraiment coincé ??,
0
anthony2008
 
est ce que mon code est correct ? svp aidez moiii
0
anthony2008
 
just epour remonter mon sijet car je suis toujour dans l'embara!!!
0
s.spark Messages postés 2485 Date d'inscription   Statut Contributeur Dernière intervention   618
 
Tu n'a toujours pas dis quel est le type de ton champs date, et ça serait bien de savoir comment tu remplis ce champs.
0
anthony2008
 
Bonjour, je suis de retour,

voila, je l'ai mis en format 'DATE'

avec DATETIME, je ne veux pas car il met les minutes

Merci de ton aide
0
s.spark Messages postés 2485 Date d'inscription   Statut Contributeur Dernière intervention   618
 
Désole j'arrête de t'aider ici, tu ne réponds pas aux questions.
0