|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kiruban Smarty Rookie
Joined: 06 Aug 2006 Posts: 8
|
Posted: Thu Aug 10, 2006 6:37 pm Post subject: date avec smarty |
|
|
Bonjour,
[php:1:2202b71564]$cado = array();
$querychamp = mysql_query("SELECT date, time, nom, prenom, titre
FROM gagnant g, membre m, jeuxcompteur j
WHERE g.gagnant = m.id_membre
AND g.cadeaux = j.id",$db);
$num = mysql_num_rows($querychamp);
if ( $num != 0) {
while($champ = mysql_fetch_assoc($querychamp)){
array_push ($cado, $champ);
}
$smarty->assign('cado',$cado);
}
$smarty->display('gagnants.tpl');
[/php:1:2202b71564]
Code: | {section name=gagnant loop=$cado}
<p>{$cado[gagnant].prenom} à gagné(e) au jeu {$cado[gagnant].titre} le {$cado[gagnant].date} à {$cado[gagnant].time}</p>
{/section}
|
ça affiche
Quote: | Vladimir à gagné(e) au jeu PSP le 2006-06-28 à 19:23:52
Julien à gagné(e) au jeu Nintendo DS le 2006-07-28 à 16:23:52
Philipe à gagné(e) au jeu Nintendo DS le 2006-08-01 à 15:23:52 |
je voudrais mettre la date en fr JJ/MM/ANNE
comment faire avec smarty ?
merci de m'aider
cordialement,
Kiruban |
|
Back to top |
|
ciboulette Smarty Regular
Joined: 13 Jul 2006 Posts: 45
|
Posted: Thu Aug 10, 2006 7:12 pm Post subject: |
|
|
Code: | {$cado[gagnant].date|date_format:"%e %B %Y"} |
|
|
Back to top |
|
kiruban Smarty Rookie
Joined: 06 Aug 2006 Posts: 8
|
Posted: Thu Aug 10, 2006 7:13 pm Post subject: |
|
|
merci beaucoup
reference JULIEN T.
Code: | {$cado[gagnant].nom|truncate:1:"."} |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|