Bonjour,
j ai transferer mon site chez phpnet et c est la galere alors que chez free tout fonctione bien là rie ne fonctione lorsqu il sagit de la gestion de ma base de donnees
pour une page de gestion d eleves ou o, peut faire des modifs, supprimer ou ajouter des eleves , il ne s affiche rien sur cette page juste les entetes et les icones
Voici ma page
<?php require_once('../Connections/connection.php');?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "-1";
if (isset($_GET['id_eleves'])) {
$colname_Recordset1 = $_GET['id_eleves'];
}
mysql_select_db($database_connection, $connection);
$query_Recordset1 = sprintf("SELECT * FROM eleves WHERE id_eleves = %s", GetSQLValueString($colname_Recordset1, "int"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_connection,$connection);
$query_Recordset1 = "SELECT * FROM eleves";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db("magpantay10");
$query_Recordset1 = "SELECT * FROM eleves";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$maxRows_Recordset1 = 5;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "-1";
if (isset($_GET['id_eleves'])) {
$colname_Recordset1 = $_GET['id_eleves'];
}
mysql_select_db("magpantay10");
$query_Recordset1 = sprintf("SELECT * FROM eleves WHERE id_eleves = %s ORDER BY id_eleves ASC", GetSQLValueString($colname_Recordset1, "int"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<!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=iso-8859-1" />
<title>Document sans titre</title>
</head>
<body>
<form method="POST" name="form1">
<table width="195" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="43" height="25" class="td_IMG"><a href="ajouterEleves.php" class="lien"><img src="img/Etoile.jpg" alt="" width="24" height="24" border="0" /></a></td>
<td width="357" class="text"> : nouveau</td>
</tr>
</table>
:
Enregistrements à sur
<p></p>
</form>
<?php echo $totalRows_Recordset1 ?> <?php echo ($startRow_Recordset1 + 1) ?><?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?>
<p align="center">
<div align="center">
<table width="417" border="0" align="center" bordercolor="#000066"bgcolor =>
<tr bordercolor="#000066">
<td width="10"> </td>
<td width="10">ID</td>
<td width="5">TITRE</td>
<td width="100">NOM</td>
<td width="100" height="20">PRENOM</td>
<td width="30">ENTREE</td>
<td width="30">NIVEAU</td>
<td width="30">PUPITRE</td>
<td width="30">SUPPRIMER</td>
<td width="30">MODIFIER</td>
</tr>
<?php do { ?>
<tr>
<td><a href="fiche.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"></a><a href="fiche_preinscription.php?id_preinscription=<?php echo $row_Recordset1['id_preinscription']; ?>"></a><a href="fiche.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"></a><a href="fiche.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"></a></td>
<td><a href="?recordID=<?php echo $row_Recordset1['id_eleves']; ?>"> <?php echo $row_Recordset1['id_eleves']; ?> </a> </td>
<td><?php echo $row_Recordset1['titre']; ?> </td>
<td><?php echo $row_Recordset1['nom']; ?> </td>
<td width="100" height="20"><?php echo $row_Recordset1['prenom']; ?> </td>
<td width="10"><div align="center"><?php echo $row_Recordset1['anciennete']; ?> </div></td>
<td><?php echo $row_Recordset1['niveau']; ?> </td>
<td><?php echo $row_Recordset1['pupitre']; ?> </td>
<td><div align="center"><a href="supp.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"></a><a href="supp.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"><img src="img/Supp.JPG" width="24" height="24" /></a></div></td>
<td><div align="center">
<h1><a href="modifsteph.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"><img src="img/Modif.jpg" width="24" height="24" /></a><a href="modifsteph.php?id_eleves=<?php echo $row_Recordset1['id_eleves']; ?>"></a></h1>
</div></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<br>
<table width="25%" border="0" align="center" bordercolor="#000066">
<tr>
<td width="23%" align="center"><a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="img/Btn_Premier.png" width="23" height="19" /></a></td>
<td width="25%" align="center"><a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="img/Btn_Precedent.png" width="17" height="19" /></a></td>
<td width="27%" align="center"><a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="img/Btn_Suivant.png" width="17" height="19" /></a></td>
<td width="25%" align="center"><a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="img/Btn_Dernier.png" width="23" height="19" /></a></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
merci de m aider je passe mon BTS prochainement et je suis désespéré
merci de votre reponse
Meme mystat qui fonctionait tres bien chez free ne fonctionnent pas chez eux
Afficher la suite
18 août 2008 à 14:48
oui je l ai fait