1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <?php require_once('Connections/test.php'); ?>
<?php
$maxRows_test = 10;
$pageNum_test = 0;
if (isset($_GET['pageNum_test'])) {
$pageNum_test = $_GET['pageNum_test'];
}
$startRow_test = $pageNum_test * $maxRows_test;
mysql_select_db($database_test, $test);
$query_test = "SELECT * FROM image";
$query_limit_test = sprintf("%s LIMIT %d, %d", $query_test, $startRow_test, $maxRows_test);
$test = mysql_query($query_limit_test, $test) or die(mysql_error());
$row_test = mysql_fetch_assoc($test);
if (isset($_GET['totalRows_test'])) {
$totalRows_test = $_GET['totalRows_test'];
} else {
$all_test = mysql_query($query_test);
$totalRows_test = mysql_num_rows($all_test);
}
$totalPages_test = ceil($totalRows_test/$maxRows_test)-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>Untitled Document</title>
</head>
<body>
<table border="0" cellpadding="2" cellspacing="2">
<tr>
<td>nom</td>
<td>photo</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_test['nom']; ?></td>
<td><?php echo $row_test['photo']; ?></td>
</tr>
<?php } while ($row_test = mysql_fetch_assoc($test)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($test);
?> |
Partager