Eléphanteau du PHP |
16 Messages
16 mai 2006, 11:19
Je vois pas trop où je dois la mettre. Je vous donne le code de ma page.
<?php require_once('../Connections/conn_product_eco.php'); ?>
<?php
$maxRows_rs_affich_news = 10;
$pageNum_rs_affich_news = 0;
if (isset($_GET['pageNum_rs_affich_news'])) {
$pageNum_rs_affich_news = $_GET['pageNum_rs_affich_news'];
}
$startRow_rs_affich_news = $pageNum_rs_affich_news * $maxRows_rs_affich_news;
mysql_select_db($database_conn_product_eco, $conn_product_eco);
$query_rs_affich_news = "SELECT * FROM news";
$query_limit_rs_affich_news = sprintf("%s LIMIT %d, %d", $query_rs_affich_news, $startRow_rs_affich_news, $maxRows_rs_affich_news);
$rs_affich_news = mysql_query($query_limit_rs_affich_news, $conn_product_eco) or die(mysql_error());
$row_rs_affich_news = mysql_fetch_assoc($rs_affich_news);
if (isset($_GET['totalRows_rs_affich_news'])) {
$totalRows_rs_affich_news = $_GET['totalRows_rs_affich_news'];
} else {
$all_rs_affich_news = mysql_query($query_rs_affich_news);
$totalRows_rs_affich_news = mysql_num_rows($all_rs_affich_news);
}
$totalPages_rs_affich_news = ceil($totalRows_rs_affich_news/$maxRows_rs_affich_news)-1;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document sans titre</title>
</head>
<body>
<table>
<tr>
<td>id_news</td>
<td>titre</td>
<td>texte</td>
<td>date</td>
<td>fichier_joint</td>
<td>niveau</td>
<td>num_conseiller</td>
<td>Fichier</td>
<td>Modifier</td>
<td>Supprimer</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rs_affich_news['id_news']; ?></td>
<td><?php echo $row_rs_affich_news['titre']; ?></td>
<td><?php echo $row_rs_affich_news['texte']; ?></td>
<td><?php echo $row_rs_affich_news['date']; ?></td>
<td><?php echo $row_rs_affich_news['fichier_joint']; ?></td>
<td><?php echo $row_rs_affich_news['niveau']; ?></td>
<td><?php echo $row_rs_affich_news['num_conseiller']; ?></td>
//c'est dans cette celllule que devra apparaître le lien
<td> <?php echo $row_rs_affich_news['fichier_joint']; ?> </td>
<td><form name="form1" method="post" action="modifier.php">
<input name="id" type="hidden" id="id" value="<?php echo $row_rs_affich_news['id_news']; ?>">
<input type="submit" name="Submit" value="Modifier">
</form></td>
<td><form name="form2" method="post" action="supprimer.php">
<input name="id" type="hidden" id="id" value="<?php echo $row_rs_affich_news['id_news']; ?>">
<input type="submit" name="Submit" value="Supprimer">
</form></td>
</tr>
<?php } while ($row_rs_affich_news = mysql_fetch_assoc($rs_affich_news)); ?>
</table>
<form name="form3" method="post" action="ajout.php">
<input type="submit" name="Submit" value="Ajouter une news">
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($rs_affich_news);
?>
Dsl si je devais pas tout mettre
Modifié en dernier par
EYMITS le 16 mai 2006, 11:42, modifié 1 fois.