Spy-master from Belgium | justement c pour un test, apres je remplace par
if($id=="id" ) voici la source complete
Code :
- <?php
- require ("config.php" );
- ?>
- <table width="100%" cellSpacing=0 cellpadding="0"><tr><td>
- <center>
- <?php
- $db = mysql_connect("$host", "$login", "$pass" );
- mysql_select_db("$base",$db);
- {
- $query = "SELECT * FROM news where id = $id";
- }
- if(!isset($id))
- {
- $query = "SELECT * FROM news WHERE couleur='$couleur' ORDER BY id DESC LIMIT 0,5";
- }
- if(!isset($couleur))
- {
- $query = "SELECT * FROM news ORDER BY id DESC LIMIT 0,5";
- }
- $result = mysql_query($query);
- while ($row = mysql_fetch_array($result)) {
- $date = $row[date];
- $annee = date("Y", $date);
- $mois = date("m", $date);
- $jour = date("d", $date);
- $heures = date("H", $date);
- $minutes = date("i", $date);
- $contenu = nl2br($row[contenu]);
- $date = "le ".$jour."/".$mois."/".$annee." à ".$heures."h".$minutes;
- echo "
- <?php
- if($id=="4" )
- {
- print "ça marche";
- }
- ?>
- \n";
- mysql_close($db);
- ?>
- <br><br>
- </tr></table>
|
Message édité par Spy-master le 29-11-2002 à 21:16:16
|