Code : Tout sélectionner
<?php require_once('../Connections/config.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ajouttuto")) {
$insertSQL = sprintf("INSERT INTO tutoriaux (editeur, titre, groupe, url, image) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['editeur'], "text"),
GetSQLValueString($_POST['titre'], "text"),
GetSQLValueString($_POST['selectgroupe'], "text"),
GetSQLValueString($_POST['url'], "text"),
GetSQLValueString($_POST['image'], "text"));
mysql_select_db($database_config, $config);
$Result1 = mysql_query($insertSQL, $config) or die(mysql_error());
$insertGoTo = "lesdonnees.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$maxRows_listetuto = 30;
$pageNum_listetuto = 0;
if (isset($_GET['pageNum_listetuto'])) {
$pageNum_listetuto = $_GET['pageNum_listetuto'];
}
$startRow_listetuto = $pageNum_listetuto * $maxRows_listetuto;
mysql_select_db($database_config, $config);
$query_listetuto = "SELECT * FROM tutoriaux ORDER BY editeur ASC";
$query_limit_listetuto = sprintf("%s LIMIT %d, %d", $query_listetuto, $startRow_listetuto, $maxRows_listetuto);
$listetuto = mysql_query($query_limit_listetuto, $config) or die(mysql_error());
$row_listetuto = mysql_fetch_assoc($listetuto);
if (isset($_GET['totalRows_listetuto'])) {
$totalRows_listetuto = $_GET['totalRows_listetuto'];
} else {
$all_listetuto = mysql_query($query_listetuto);
$totalRows_listetuto = mysql_num_rows($all_listetuto);
}
$totalPages_listetuto = ceil($totalRows_listetuto/$maxRows_listetuto)-1;
$queryString_listetuto = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_listetuto") == false &&
stristr($param, "totalRows_listetuto") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_listetuto = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_listetuto = sprintf("&totalRows_listetuto=%d%s", $totalRows_listetuto, $queryString_listetuto);
?><!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"><!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>| Accueil | Admin</title>
<!-- InstanceEndEditable -->
<link href="admincss.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<table width="933" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="103" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="933" height="103" class="tdheader">Administration TUTOlink.org </td>
</tr>
</table> </td>
</tr>
<tr>
<td width="155" height="464" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="260" height="464" valign="top" class="tdgauchemenu"><table width="105" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>Accueil</td>
</tr>
<tr>
<td>les demandes </td>
</tr>
<tr>
<td><a href="lesdonnees.php">les données </a></td>
</tr>
<tr>
<td>annuaire</td>
</tr>
<tr>
<td><a href="newsletters.php">Newsletters</a></td>
</tr>
<tr>
<td>demande d'info </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Config sql </td>
</tr>
<tr>
<td><div align="right"><a href="<?php echo $logoutAction ?>">deconnexion</a></div></td>
</tr>
</table>
<p> </p>
</td>
</tr>
</table></td>
<td width="778" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr><!-- InstanceBeginEditable name="page" -->
<td width="778" height="464" valign="top" class="contenu"><table width="356" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="tdgauchemenu">
<td width="90"><div align="center"><a href="lesdonnees.php">tutoriaux</a></div></td>
<td width="82"><div align="center"><a href="brush/brush.php">Brush</a></div></td>
<td width="88"><div align="center">Fonts</div></td>
<td width="96"><div align="center">Degradé</div></td>
</tr>
</table>
<p> </p>
<table width="295" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="295" class="ligneentetetuto">Ajout d'un tutorial à la base de donnée. </td>
</tr>
<tr>
<td height="141" class="ligneentetetuto"><form id="ajouttuto" name="ajouttuto" method="POST" action="<?php echo $editFormAction; ?>">
<table width="276" border="0" align="center" cellpadding="0" cellspacing="0" class="lignetuto">
<tr>
<td width="129"><div align="right">Editeur:</div></td>
<td width="147"><label>
<input name="editeur" type="text" class="lignetuto" id="editeur" />
</label></td>
</tr>
<tr>
<td><div align="right">Titre du tutorial: </div></td>
<td><label>
<input name="titre" type="text" class="lignetuto" id="titre" />
</label></td>
</tr>
<tr>
<td><div align="right">Groupe:</div></td>
<td><label>
<select name="selectgroupe" class="lignetuto" id="selectgroupe">
<option value="technique">technique</option>
<option value="texture">texture</option>
<option value="objet">objet</option>
<option value="effettexte">effettexte</option>
<option value="web">web</option>
<option value="effetimage">effetimage</option>
</select>
</label></td>
</tr>
<tr>
<td><div align="right">Url:</div></td>
<td><label>
<input name="url" type="text" class="lignetuto" id="url" />
</label></td>
</tr>
<tr>
<td><div align="right">Image:</div></td>
<td><label>
<input name="image" type="text" class="lignetuto" id="image" />
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<div align="center">
<input type="submit" name="Submit" value="Ajouter" />
</div>
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="ajouttuto">
</form>
</td>
</tr>
</table>
<p> </p>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="tdgauchemenu">
<td width="83" class="ligneentetetuto">id</td>
<td width="158" class="ligneentetetuto">éditeur</td>
<td width="332" class="ligneentetetuto">titre</td>
<td width="117" class="ligneentetetuto">groupe</td>
<td width="22" class="ligneentetetuto"> </td>
<td width="23" class="ligneentetetuto"> </td>
<td width="25" class="ligneentetetuto"> </td>
</tr>
<?php do { ?>
<tr class="tabnormal" onmouseover="this.className='tabover'" onmouseout="this.className='tabnormal'">
<td><?php echo $row_listetuto['id']; ?></td>
<td><?php echo $row_listetuto['editeur']; ?></td>
<td><?php echo $row_listetuto['titre']; ?></td>
<td><?php echo $row_listetuto['groupe']; ?></td>
<td><div align="center"><a href="modif_tuto.php?modifID=<?php echo $row_listetuto['id']; ?>"><img src="images/16-tool-b.png" width="16" height="16" border="0" /></a></div></td>
<td><div align="center"><a href="tutoriaux/viewtuto.php?viewID=<?php echo $row_listetuto['id']; ?>"><img src="images/16-zoom.png" width="16" height="16" border="0" /></a></div></td>
<td><div align="center"><img src="images/16-square-green-delete.png" width="16" height="16" /></div></td>
</tr>
<?php } while ($row_listetuto = mysql_fetch_assoc($listetuto)); ?>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="33" valign="top"><table width="50%" border="0" align="center" class="tdgauchemenu">
<tr>
<td width="23%" align="center"><?php if ($pageNum_listetuto > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, 0, $queryString_listetuto); ?>">Premier</a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_listetuto > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, max(0, $pageNum_listetuto - 1), $queryString_listetuto); ?>">Précédent</a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_listetuto < $totalPages_listetuto) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, min($totalPages_listetuto, $pageNum_listetuto + 1), $queryString_listetuto); ?>">Suivant</a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_listetuto < $totalPages_listetuto) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, $totalPages_listetuto, $queryString_listetuto); ?>">Dernier</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<p> </p></td>
<!-- InstanceEndEditable --></tr>
</table>
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($listetuto);
?>
<?php require_once('../Connections/config.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ajouttuto")) {
$insertSQL = sprintf("INSERT INTO tutoriaux (editeur, titre, groupe, url, image) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['editeur'], "text"),
GetSQLValueString($_POST['titre'], "text"),
GetSQLValueString($_POST['selectgroupe'], "text"),
GetSQLValueString($_POST['url'], "text"),
GetSQLValueString($_POST['image'], "text"));
mysql_select_db($database_config, $config);
$Result1 = mysql_query($insertSQL, $config) or die(mysql_error());
$insertGoTo = "lesdonnees.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$maxRows_listetuto = 30;
$pageNum_listetuto = 0;
if (isset($_GET['pageNum_listetuto'])) {
$pageNum_listetuto = $_GET['pageNum_listetuto'];
}
$startRow_listetuto = $pageNum_listetuto * $maxRows_listetuto;
mysql_select_db($database_config, $config);
$query_listetuto = "SELECT * FROM tutoriaux ORDER BY editeur ASC";
$query_limit_listetuto = sprintf("%s LIMIT %d, %d", $query_listetuto, $startRow_listetuto, $maxRows_listetuto);
$listetuto = mysql_query($query_limit_listetuto, $config) or die(mysql_error());
$row_listetuto = mysql_fetch_assoc($listetuto);
if (isset($_GET['totalRows_listetuto'])) {
$totalRows_listetuto = $_GET['totalRows_listetuto'];
} else {
$all_listetuto = mysql_query($query_listetuto);
$totalRows_listetuto = mysql_num_rows($all_listetuto);
}
$totalPages_listetuto = ceil($totalRows_listetuto/$maxRows_listetuto)-1;
$queryString_listetuto = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_listetuto") == false &&
stristr($param, "totalRows_listetuto") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_listetuto = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_listetuto = sprintf("&totalRows_listetuto=%d%s", $totalRows_listetuto, $queryString_listetuto);
?><!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"><!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>| Accueil | Admin</title>
<!-- InstanceEndEditable -->
<link href="admincss.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<table width="933" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="103" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="933" height="103" class="tdheader">Administration TUTOlink.org </td>
</tr>
</table> </td>
</tr>
<tr>
<td width="155" height="464" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="260" height="464" valign="top" class="tdgauchemenu"><table width="105" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>Accueil</td>
</tr>
<tr>
<td>les demandes </td>
</tr>
<tr>
<td><a href="lesdonnees.php">les données </a></td>
</tr>
<tr>
<td>annuaire</td>
</tr>
<tr>
<td><a href="newsletters.php">Newsletters</a></td>
</tr>
<tr>
<td>demande d'info </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Config sql </td>
</tr>
<tr>
<td><div align="right"><a href="<?php echo $logoutAction ?>">deconnexion</a></div></td>
</tr>
</table>
<p> </p>
</td>
</tr>
</table></td>
<td width="778" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr><!-- InstanceBeginEditable name="page" -->
<td width="778" height="464" valign="top" class="contenu"><table width="356" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="tdgauchemenu">
<td width="90"><div align="center"><a href="lesdonnees.php">tutoriaux</a></div></td>
<td width="82"><div align="center"><a href="brush/brush.php">Brush</a></div></td>
<td width="88"><div align="center">Fonts</div></td>
<td width="96"><div align="center">Degradé</div></td>
</tr>
</table>
<p> </p>
<table width="295" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="295" class="ligneentetetuto">Ajout d'un tutorial à la base de donnée. </td>
</tr>
<tr>
<td height="141" class="ligneentetetuto"><form id="ajouttuto" name="ajouttuto" method="POST" action="<?php echo $editFormAction; ?>">
<table width="276" border="0" align="center" cellpadding="0" cellspacing="0" class="lignetuto">
<tr>
<td width="129"><div align="right">Editeur:</div></td>
<td width="147"><label>
<input name="editeur" type="text" class="lignetuto" id="editeur" />
</label></td>
</tr>
<tr>
<td><div align="right">Titre du tutorial: </div></td>
<td><label>
<input name="titre" type="text" class="lignetuto" id="titre" />
</label></td>
</tr>
<tr>
<td><div align="right">Groupe:</div></td>
<td><label>
<select name="selectgroupe" class="lignetuto" id="selectgroupe">
<option value="technique">technique</option>
<option value="texture">texture</option>
<option value="objet">objet</option>
<option value="effettexte">effettexte</option>
<option value="web">web</option>
<option value="effetimage">effetimage</option>
</select>
</label></td>
</tr>
<tr>
<td><div align="right">Url:</div></td>
<td><label>
<input name="url" type="text" class="lignetuto" id="url" />
</label></td>
</tr>
<tr>
<td><div align="right">Image:</div></td>
<td><label>
<input name="image" type="text" class="lignetuto" id="image" />
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<div align="center">
<input type="submit" name="Submit" value="Ajouter" />
</div>
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="ajouttuto">
</form>
</td>
</tr>
</table>
<p> </p>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="tdgauchemenu">
<td width="83" class="ligneentetetuto">id</td>
<td width="158" class="ligneentetetuto">éditeur</td>
<td width="332" class="ligneentetetuto">titre</td>
<td width="117" class="ligneentetetuto">groupe</td>
<td width="22" class="ligneentetetuto"> </td>
<td width="23" class="ligneentetetuto"> </td>
<td width="25" class="ligneentetetuto"> </td>
</tr>
<?php do { ?>
<tr class="tabnormal" onmouseover="this.className='tabover'" onmouseout="this.className='tabnormal'">
<td><?php echo $row_listetuto['id']; ?></td>
<td><?php echo $row_listetuto['editeur']; ?></td>
<td><?php echo $row_listetuto['titre']; ?></td>
<td><?php echo $row_listetuto['groupe']; ?></td>
<td><div align="center"><a href="modif_tuto.php?modifID=<?php echo $row_listetuto['id']; ?>"><img src="images/16-tool-b.png" width="16" height="16" border="0" /></a></div></td>
<td><div align="center"><a href="tutoriaux/viewtuto.php?viewID=<?php echo $row_listetuto['id']; ?>"><img src="images/16-zoom.png" width="16" height="16" border="0" /></a></div></td>
<td><div align="center"><img src="images/16-square-green-delete.png" width="16" height="16" /></div></td>
</tr>
<?php } while ($row_listetuto = mysql_fetch_assoc($listetuto)); ?>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="33" valign="top"><table width="50%" border="0" align="center" class="tdgauchemenu">
<tr>
<td width="23%" align="center"><?php if ($pageNum_listetuto > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, 0, $queryString_listetuto); ?>">Premier</a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_listetuto > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, max(0, $pageNum_listetuto - 1), $queryString_listetuto); ?>">Précédent</a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_listetuto < $totalPages_listetuto) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, min($totalPages_listetuto, $pageNum_listetuto + 1), $queryString_listetuto); ?>">Suivant</a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_listetuto < $totalPages_listetuto) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_listetuto=%d%s", $currentPage, $totalPages_listetuto, $queryString_listetuto); ?>">Dernier</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<p> </p></td>
<!-- InstanceEndEditable --></tr>
</table>
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($listetuto);
?>
En faite je trouve bizarre car l'affichage de la région répéter fonctionne tres bien pour les 2378 enregistrement de la table.
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;
}
}
note : le "if (!function_exists("GetSQLValueString"))" est pour rendre le script compatible php5 au cas où cette fonction serait déclarée par ailleurs (fichiers inclus par exemples).$pageNum_listetuto = 0;
if (isset($_GET['pageNum_listetuto'])) {
$pageNum_listetuto = $_GET['pageNum_listetuto'];
}
qui pourrait être avantageusement remplacé par
$pageNum_listetuto = isset($_GET['pageNum_listetuto'])? $_GET['pageNum_listetuto'] : 0;
Bon, c'est juste un peu d'optimisation en passant mais ça ne résoudra pas ton pb.Pour repondre à ta question, les enregistrements que j'ajoute à la table avec le formulaire d'ajout figure bien sur celle ci, par contre impossible de les faire apparaitre à la suite les autresEst ce que lorsque tu ajoutes les enregistrements, ils sont bien dans ta base de données ? Si tu actualises la page, est ce que tu retrouve tes enregistrements manquants ?
Code : Tout sélectionner
--
-- Structure de la table `tutoriaux`
--
CREATE TABLE `tutoriaux` (
`editeur` varchar(150) NOT NULL default '',
`titre` varchar(150) NOT NULL default '',
`groupe` varchar(150) NOT NULL default '',
`url` text NOT NULL,
`image` varchar(150) default NULL,
`id` smallint(6) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2382 ;
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ajouttuto")) {
$insertSQL = sprintf("INSERT INTO tutoriaux (editeur, titre, groupe, url, image) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['editeur'], "text"),
GetSQLValueString($_POST['titre'], "text"),
GetSQLValueString($_POST['selectgroupe'], "text"),
GetSQLValueString($_POST['url'], "text"),
GetSQLValueString($_POST['image'], "text"));
mysql_select_db($database_config, $config);
$Result1 = mysql_query($insertSQL, $config) or die(mysql_error());
$insertGoTo = "lesdonnees.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
Et pourquoi $insertGoTo = "lesdonnees.php"; J'ai testé avec $insertGoTo = ""; et mes nouveaux enregistrements sont affichés (bonne idée d'avoir donné ta table pour tester)