je sais qu'aujourd'hui les connections sql - php ne se font plus, mais je suis un peu trop agé pour apprendre un nouveau langage et la majeure partie de mon site est déjà comme cela.
j'ai donc mes données issues d'une base sql que j'ai réussi à afficher et à trier, mais certaines données devraient être fusionnées: les sports (athlétisme, canoe...) afin que la première colonne du tableausoit fusionné fusionné et et les disciplines d'un sport (canoe slalom, canoe sprint, ...) afin que la deuxième colonne du tableau soit fusionné si elle existe.
ma requette:
Code : Tout sélectionner
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_jo, $jo);
$query_Rs6aout = "SELECT * FROM programme, epreuve, jour, jeux, categorie, sexe, competition, poids WHERE programme.JeuxID=jeux.JeuxID AND programme.JourID=jour.JourID AND programme.EpreuveID=epreuve.EpreuveID AND epreuve.CategorieID=categorie.CategorieID AND epreuve.SexeID=sexe.SexeID AND epreuve.CompetID=competition.CompetID AND epreuve.PoidsID=poids.PoidsID AND programme.JeuxID=62 AND programme.JourID=219 ORDER BY competition.Sport, competition.Disicipline, programme.Heure, epreuve.Epreuve, programme.Obs, programme.Finale";
$Rs6aout = mysql_query($query_Rs6aout, $jo) or die(mysql_error());
$row_Rs6aout = mysql_fetch_assoc($Rs6aout);
$totalRows_Rs6aout = mysql_num_rows($Rs6aout);
?>Code : Tout sélectionner
<td>
<?php do { ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="disc"><img src="../images/fede/<?php echo $row_Rs6aout['logo']; ?>" alt="fede" width="25" height="25"/> <?php echo $row_Rs6aout['Sport']; ?> <?php echo $row_Rs6aout['Disicipline']; ?></td>
<td width="10%"><?php echo $row_Rs6aout['Heure']; ?></td>
<td><? if ($row_Rs6aout['Finale']==1) echo "<strong>"."<em>"; ?><?php echo $row_Rs6aout['Epreuve']; ?> <?php echo $row_Rs6aout['Categorie']; ?> <?php echo $row_Rs6aout['Sexe']; ?> <?php echo $row_Rs6aout['Obs']; ?><? if ($row_Rs6aout['Finale']==1) echo "</em>"."</strong>"; ?></td>
</tr>
</table>
<?php } while ($row_Rs6aout = mysql_fetch_assoc($Rs6aout)); ?>
</td>merci pour votre aide