8800 sujets

Développement web côté serveur, CMS

Bonjour je souhaite afficher le contenu de ma table film qui est dans ma base videojb.

Pour cela j'utilise une class_connexion pour la connexion et un while pour afficher son contenu mais rien ne s'affiche pourquoi ?

Merci d'avance!

<?php
	session_start();
	if(!isset($_SESSION['log'])) {
		header('location:index.php');
	require_once ("connexion/class.Connexion.php");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<title>Document sans titre</title>
<style type="text/css">
}
table{
border:solid 2px #009999;
cellspacing:0px;
cellspadding:0px;
}
th{
color:#FFFFFF;
background-color:#000033;
padding:10px;
}
td{
border:solid 1px #009999;
padding:10px;
}
</style>
</head>

<body>

<div class="header">
<?php echo '<strong class="bleu">Bonjour '.$_SESSION['log'].'</strong>'; ?> 
 
<?php include('menu/menu.php') ?>
<br />
<h1><em>Espace membre !</em></h1>
</div>

<div class="conteneur">

<table>
<thead>
<tr>
<th>N°</th>
<th>Titre du Film</th>
<th>Réalisation</th>
<th>Musique</th>
<th>Genre</th>
<th>Origine</th>
<th>Année</th>
<th>Durée</th>
</tr>
</thead>
<tbody>

<?php
function authentification() {
    $Connexion = new DBConfig();
    $uneConnexion = $Connexion->connexion();


// on crée la requête SQL
$sql = 'SELECT * FROM film';

// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

// on fait une boucle qui va faire un tour pour chaque enregistrement
while($data = mysql_fetch_assoc($req))
    {
	?>
<?php echo $data['film_numero']; ?>
<?php echo $data['film_titre_film']; ?>
<?php
 }
 }
?>
 
</tbody>
</table>

</div>
</body>
</html>

Modifié par Designarca (15 Jan 2011 - 23:56)